Solved

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

Posted on 2010-09-10
11
872 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
  • 7
  • 4
11 Comments
 
LVL 42

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 30

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 30

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
 
LVL 42

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 42

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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 30

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 30

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 30

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 42

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 30

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 30

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
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…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now