View Full Version : css external js files and browser sniffing

03-26-2010, 09:32 PM
how do I declare and call a function from an external js file so that it loads a specific css file based on a browser that's being used. I want this js file to be used on several pages so an internal script tags shouldn't be used.
Here's what I want to do.
Safari is the only browser that supports certain CSS3 styles that I'm using. I want to use a certain stylesheet if Safari is used and if not use the master stylesheet
Example: version3.css for Safari and master.css for all others

I'm kind of a beginner to javascript so the simpler the better(I don't want to work with nodes).

03-27-2010, 10:23 AM
In most cases unsupported style will simply be ignored by those browsers that do not support it. No need to sniff anything.