Hey,
I'm trying to write a stylesheet switcher. What should happen in this switcher is that, on page load, it will detect whether you are using Internet Explorer or another browser, and then it will load the appropriate stylesheet.
This is what i've got so far:
i'm not sure how to tell it to put "style.css" or "styleIE.css" in the appropriate location, which would be in the header like so:PHP Code://Stylesheet Switcher
if (navigator.appName = Microsoft Internet Explorer) {
document.write("styleIE.css")
}
else {
document.write("style.css")
}
and then i'm guessing the code to execute the script would beCode:<link rel="stylesheet" type="text/css" href="*correctstylesheetname*">
can somebody check my work and offer assistance where necessary?Code:<body onload="styleswitcher.js">
Thanks!


Reply With Quote
Bookmarks