Categories
Contact Doug!
Learn About Doug!
View Doug Boude's online resume
updated 11/18/2009

View Doug Boude's profile on LinkedIn
Link to me!

Follow Doug Boude on Twitter
Follow me!

Be Doug's friend on Facebook
Befriend me!
(I promise not to follow you home)
OO Lexicon
Chat with Doug!
Recent Entries
You may also be interested in...
Web Hosting

<< May, 2013 >>
SMTWTFS
1234
567891011
12131415161718
19202122232425
262728293031
Search Blog

Recent Comments
Re: Disappearing IE Popup Window During Save/Open Dialog (by LZ at 4/20 7:58 AM)
Re: Create Dynamic WHERE Clauses in PHP (by pooja at 3/20 7:29 AM)
Re: Just What IS a 'Service Layer', Anyway? (by EugenK at 3/07 7:56 PM)
Re: Using Google as your CF Mail Server (by 5starwebteam.com at 2/25 1:27 AM)
Re: Why Provide for Service layer objects in CFWheels? (by Steven Benjamin at 1/25 11:43 AM)
Re: What is an 'Advanced' Coldfusion Developer? (by ColdFusion Developer at 12/24 5:14 AM)
Re: Equivalent of SQL "TOP X" in Oracle (by Ashenafi Desalegn at 12/06 5:29 AM)
Re: PHP Export to Excel Snippet (by serene at 12/05 1:44 AM)
Re: Just What Is 'Application Logic', Anyway? (by Arif at 11/13 8:06 AM)
Re: Hosts File Changes Not Acknowledged on Vista 64 (by Aaron at 10/22 2:31 PM)
Re: PHP Export to Excel Snippet (by Jafar Shah at 10/10 4:28 AM)
Re: Viewing Option Text (in IE7) that's Wider than the Select List (by Chenelle S at 10/04 12:53 PM)
Re: PHP Export to Excel Snippet (by Kilo at 9/26 5:20 PM)
Re: Porting Coldfusion Code to Mura (by tariq at 9/03 9:51 AM)
Re: Just What IS a 'Service Layer', Anyway? (by James at 8/27 4:06 PM)
Re: Calculating Business Hours (by helen at 8/14 2:54 AM)
Re: What IS 'Business Logic', Anyway? (by dougboude at 8/06 11:30 AM)
Re: What IS 'Business Logic', Anyway? (by Adrianne at 8/06 10:29 AM)
Re: Family Law: The Weapon of Choice for Woman Scorned (by dougboude at 8/04 4:39 PM)
Re: Family Law: The Weapon of Choice for Woman Scorned (by Lola LB at 8/04 7:43 AM)
Archives
Photo Albums
Funnies (5)
Family (3)
RSS

Powered by
BlogCFM v1.11

14 May 2008
Inline CSS and Ajax Issue with IE
IE Got Me Again
After spending more time than I care to say troubleshooting a CSS issue with IE7, I thought I'd share the details here in case it saves anybody else some time later down the road.

The Scenario...
I have an application that updates the contents of one of its divs using an ajax call that returns html. Within that retrieved html is a style block (<style>...</style>) defining how I want my table headers (<th>...also contained within the retrieved html) to appear.

IN A NUTSHELL: IE7 does not recognize inline styles that were retrieved via an ajax call.

Perhaps this is a "duh" item to some of you who already knew it, but since my beloved FIREFOX accepted them just fine, it didn't occur to me until I had tried every other possible iteration and syntax to move the styles out of my retrieved html and into my app's global CSS template, which (by the way), is the solution to this issue.

Hope this saves someone else some time and emotional pain.



Posted by dougboude at 11:00 AM | PRINT THIS POST! |Link | 9 comments
Subscription Options

You are not logged in, so your subscription status for this entry is unknown. You can login or register here.

Re: Inline CSS and Ajax Issue with IE
This seems like a crazy bug to me. I am surprised that this happens. Why can't everything be a bit more like FireFox :)
Posted by Ben Nadel on May 14, 2008 at 11:50 AM

Re: Inline CSS and Ajax Issue with IE
Oh My God! Thank YOU!!! I can't believe I found this little bit of info - which has indeed saved me hours of futile cursing at IE and the 2 brain-celled idiots that work there.

Many thanks for the tip :-)
Posted by whimZefx on May 18, 2008 at 7:09 AM

Re: Inline CSS and Ajax Issue with IE
Glad it saved someone else some headache and hair pulling, WhimZefx. :) That's EXACTLY why we should all share the things we learn. ;)
Posted by dougboude on May 18, 2008 at 3:34 PM

Re: Inline CSS and Ajax Issue with IE
If you are creating elements via the DOM, the CSS class attribute must be specified with JavaScript; IE 7 doesn't validate or re-parse any .setAttribute calls

element.className = 'SomeCssClasDeclaredInTheGlobalStyleSheet';
Posted by xdor on December 3, 2008 at 2:06 PM

Re: Inline CSS and Ajax Issue with IE
Thanks, Doug!

Just wanted to verify that the same issue is in place for IE6. Adding all the style information AND links to external stylesheets OUTSIDE of the area with the code being replaced fixed things up just fine.
Posted by cc on April 3, 2009 at 1:48 PM

Re: Inline CSS and Ajax Issue with IE
hi,

it seems to me that Firefox3 is not applying inline css anymore?

Some code that worked now is not in FF... all I do is to
Posted by Cris Rus on May 15, 2009 at 6:54 AM

Re: Inline CSS and Ajax Issue with IE
I have added the style in GLOBAL CSS but still not able to get the effect of dat Style in I.E. but where in firefox it is working fine....
If my WebPage is normal page (Page not called from Ajax) then CSS is working Fine in I.E. but as soon as dat page from Ajax the effect from CSS is negligible.

IN firefox it is working fine but not in I.E.
Posted by sachin on January 5, 2010 at 6:38 AM

Re: Inline CSS and Ajax Issue with IE
@sachin - yeah, retrieving html content that contains its own css when in IE...IE ignores the css. You have to put those styles outside the ajax call, in the container page in order for the css to be applied to html retrieved via ajax in IE. Just a weird bug I discovered a while back.
Posted by dougboude on January 5, 2010 at 8:56 AM

Re: Inline CSS and Ajax Issue with IE
Thanks for ur prompt reply.

There is no style in the file which is called from ajax.I am using only one file that is Global CSS.And from ajax file only simple html and updated information from server is coming.So no style is coming from Ajax.Let me send you the url where u can check.

http://www.newmiamiarch.org/ip.asp?op=Events_ShowAll_Masses .When u will navigate this ,then u will see on calendar on the right hand side.Please click on the small pics in the caledar then ajax function will call and u will see the difference in FONTS and the colour of the heading and title is everthing is same except the FONTS.

And also click on the right hand side the list of events to check the difference between the navigation through calendar on the right hand side and the list of events below the calendar.This difference is only in I.E.I think CSS is working coz the colour of the heading and title is same,only fonts differ.And for the fonts i am using below class

.styledefault{
font-family:Georgia,Times New Roman,Times, serif;
font-size:12px;
color:#7e7d7d;
line-height:16px;
}

Thanks,
Sachin
Posted by sachin on January 11, 2010 at 1:12 AM

Name:   Required
Email:   Required your email address will not be publicly displayed.

Want to receive notifications when new comments are added? Login/Register for an account.

Time to take the Turing Test!!!

Zero plus Fifteen equals
Type in the answer to the question you see above:

Your comment:

Sorry, no HTML allowed!