Solved

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

Posted on 2010-09-10
11
875 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

828 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