[Javascript] link to external .css file based on browser detect

Josiah Gordon jgordon at directfile.com
Fri Jun 1 18:45:43 CDT 2001


Jonathan,

> > Is it possible (how) to link to a different external stylesheet based on
a
> > browswer detect?

I do not know if that is possible (and if it is it will be probably be a
cross platform nightmare), however you could achieve the same functionality
by:
    1) letting the page load
    2) do your javascript browser detection
    3) change class, ID, and element CSS(s) on the fly with javascript.
You'd have to use an external .js file instead of .css, but with a bit of
code (and a few arrays) you could do what you are apparently after,
client-side. Your users will probably notice the change -- server-side
detection will yield a much cleaner look.


--Josiah Gordon





More information about the Javascript mailing list