I am trying to implement a new navigation menu on a web site.
Because NS4 renders fonts 1pt smaller than IE, I am using some browser detection to call the appropriate menu.js file.
Here’s the relevent code so far (no lines wrap despite what you may see here):
<script language=”JavaScript1.2″>
<!–
var browser_type = navigator.appName;
var browser_version = parseInt(navigator.appVersion);
//if NS 6+
if (browser_type == “Netscape” && browser_version >= 5) {
document.write(“<script type=’text/javascript’ language=’JavaScript1.2′ src=’menu.js’></script>”);
}
//if IE 4+
else if (browser_type == “Microsoft Internet Explorer” && browser_version >= 4) {
document.write(“<script type=’text/javascript’ language=’JavaScript1.2′ src=’menu-ie.js’></script>”);
}
//if NS 4+
else if (browser_type == “Netscape” && browser_version == 4) {
document.write(“<script type=’text/javascript’ language=’JavaScript1.2′ src=’menu-nn.js’></script>”);
}
// –>
</script>
IE seems happy with this, but NS is choking.
NS7 will display the entire page EXCEPT for the menu.
NS4 just chokes and has to be killed off.
I’ve discovered some interesting things:
1.
If I modify the document.write from
src=’menu.js’>
to
src=’menu.js’>
I will get the menu on NS7 and IE, but everything in the body is missing until I hit a later </script> tag further down in my page. NS4 displays nothing from the menu down.
If I now add an additional </script> at the bottom of the nav script so that it now looks like
// –>
</script>
</script>
NS7 and IE displays everything, but NS4 will only display the page body without a menu. Apparently, the script is not being terminated properly.
I’ve tried so many things, like additional escapes ()
The entire page can be found at [url]http://www.symark.com/testnav.htm
Thanks in advance.