I'm pretty much a javascript novice, and hope someone can help me with this attempt to write one link to a CSS file if the user is on Netscape 4, 4.7x etc. (where stuff tends to explode), and one for IE 5 and above. I'm trying to keep it as simple as possible. Here's what I have so far:
<SCRIPT LANGUAGE="JavaScript">
<!--
if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) < 4 )) {
document.write("<LINK REL=stylesheet HREF=http://www.webdeveloper.com/forum/archive/index.php/\"../file2.css\" TYPE=\"text/css\">"); }
else {
document.write("<LINK REL=stylesheet HREF=\"../file.css\" TYPE=\"text/css\">"); }
// -->
</SCRIPT>
Doesn't seem to be working, though. Netscape 4.7 appears to still be calling up file.css instead of file2.css. The script is successfully writing file.css for IE 5, though. Can anyone help? Much appreciated if so.
<SCRIPT LANGUAGE="JavaScript">
<!--
if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) < 4 )) {
document.write("<LINK REL=stylesheet HREF=http://www.webdeveloper.com/forum/archive/index.php/\"../file2.css\" TYPE=\"text/css\">"); }
else {
document.write("<LINK REL=stylesheet HREF=\"../file.css\" TYPE=\"text/css\">"); }
// -->
</SCRIPT>
Doesn't seem to be working, though. Netscape 4.7 appears to still be calling up file.css instead of file2.css. The script is successfully writing file.css for IE 5, though. Can anyone help? Much appreciated if so.