Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Ajax CSS IE8 (FF, Chrome work, but not IE8)

Posted on 2010-09-10
11
Medium Priority
?
880 Views
Last Modified: 2012-05-10
Hello All;

I am trying to load some CSS through AJAX.
This works for FF and Chrome, but not in IE8 (Possibly none of the IE's)

IE8 could very well be doing it correctly, since it is running through a "div"
And css most likely is not suppose to run through a div?

Test with: FF and Chome, click the Submit, and it will change to [Black]
IE does not change...
http://ee.cffcs.com/ajax/css/1.asp
code
http://ee.cffcs.com/ajax/css/ajax.zip

Anyway around this?

On my site, I have it so people can use a Profile Create to design their profiles.
And I am using AJAX to allow for them to see everything in real-time.
This IE deal, is the only thing that is stopping the profile editor to go live
Of which I am hoping will be later on this after towards the evening.

I just ran a test to see if CSS can in fact load through a <div> and it can.
BUT, it will not load the CSS coming through the AJAX.

Thank you all.
Carrzkiss
0
Comment
Question by:Wayne Barron
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
11 Comments
 
LVL 43

Expert Comment

by:David S.
ID: 33651425
All I see on the page is "Service Unavailable".

Would you please post the relevant JavaScript code separately?
0
 
LVL 31

Author Comment

by:Wayne Barron
ID: 33651622
Yea, aint that crap.
I contacted the hosting company and they are trying to fix it.
THe bad thing is that it is only on our account.
This is the 2nd time this week that it has happened....

Maybe it will be back up later on.


ajax.zip
0
 
LVL 31

Author Comment

by:Wayne Barron
ID: 33651689
hey Kravimir
I just downloaded another code that is jQuery.
And am "attempting" to implement this project into it.
BUT, within the example that I downloaded, I was able to send the css through
So, it is the ajax that I am using here that is not working in IE8.


form.zip
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 43

Expert Comment

by:David S.
ID: 33651710
So you're receiving a <style> element with some style rules from an AJAX request and then you're just adding to a <div>? I'm not surprised that it doesn't work. For one thing, <link> and <style> elements should always be children of the <head> element. Also adding new stylesheets on the fly is more difficult than it should be (there are several compatibility issues in this area).

Why are you using AJAX anyway? As far as I can tell you're not doing anything with it that you could do directly with just JS. If you were saving the styles to a database it would make sense, but you don't seem to be doing that.

Check these out:
http://www.phpied.com/dynamic-script-and-style-elements-in-ie/
http://www.hunlock.com/blogs/Totally_Pwn_CSS_with_Javascript
0
 
LVL 43

Expert Comment

by:David S.
ID: 33651732
That other code you found is not very well written and besides jQuery 1.2.6 is rather old. The current version is 1.4.2.
0
 
LVL 31

Author Comment

by:Wayne Barron
ID: 33651748
ok.

The real site does the following.

The user is able to create their online profile before submitting it to the database.
The Ajax comes in when the user is testing the new css settings that they have created.
Once they get the styles that they want, then they choose to save it and it is inserted into the database.


Now.
The jQuery script that I just uploaded, does this.
So, I am going to work with learning on how to implement what I need with it.

have a good one
Carrzkiss
0
 
LVL 31

Author Comment

by:Wayne Barron
ID: 33651753
do you have a link to some code that is done with the new current version with ASP Classic?
That is the only example that I could find with Classic ASP and jQuery.

Thanks.
0
 
LVL 31

Author Comment

by:Wayne Barron
ID: 33651852
@Kravimir

Please let me know if you know of any tutorials with the new jQuery and Classic ASP?
If you do not, please let me know so that I am not sitting here waiting on something that is not coming...

Carrzkiss
0
 
LVL 43

Expert Comment

by:David S.
ID: 33652008
I don't use ASP myself, so no, I don't know of a better example than the one you found. You may be able to just switch in the current version of jQuery without changing the rest of the code.

There's always the chance that someone else might reply.
0
 
LVL 31

Author Comment

by:Wayne Barron
ID: 33653834
thanks
I have been playing around with the code and cannot get it to work.
Then again, I do not really understand, so it is going to be a learning process.

Have a good weekend.
Carrzkiss
0
 
LVL 31

Accepted Solution

by:
Wayne Barron earned 0 total points
ID: 33734854
This issue is resolved.
Please go here for all the information and the sample code to download and test.

http://www.experts-exchange.com/Q_26467036.html

Have a good one.
Carrzkiss
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question