Safari Doesn't Seem To Like CSS Coming From AJAX

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
volomike
Forum Regular
Posts: 633
Joined: Wed Jan 16, 2008 9:04 am
Location: Myrtle Beach, South Carolina, USA

Safari Doesn't Seem To Like CSS Coming From AJAX

Post by volomike »

I just discovered that if I use $('#myDiv').load('page.php') with jQuery, which pulls back a page's contents over AJAX, and try to stick a STYLE tag inside that page to style elements -- Safari won't load that! Man, that blows. Every other browser, however, handles this just fine. The workaround was that on the load of the container page (the one that had the jQuery call), I had to put the STYLE stuff there, and make it load only if the user is running Safari.
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: Safari Doesn't Seem To Like CSS Coming From AJAX

Post by JAB Creations »

No...that's just a horrible way to apply styling. I'm against even putting script elements nested within the body element much less style elements! In fact I'm pretty sure that it's completely invalid offhand.

You should stick to using classes and id's on those elements you load via AJAX.
Post Reply