Forum Moderators: open
<SCRIPT language="JavaScript1.1">
<!--
location.replace("http://newurl.com/newpage.html");
file://-->
</SCRIPT>
placing it in the body of the page.
However this is not working with Netscape 4.6. (JS is turned on) Works fine in IE.
Is this just a NS problem?
Thanks for your help.
Ken
The final line:
file://-->is not familiar js code to me. From what I see the script should end at the semicolon.
I'm also not sure that placing this code in the body of the page is a good idea -- either pacing it in the head or calling it from an external file leaves less room for problems.
You can get a clue about JavaScript problems from the Netscape javascript console. In the browser location bar, type javascript: (be sure to include the colon) You'll get a cryptic message that can help pinpoint the line any errors occur on and, at least roughly, what they are.
I removed the file: part and the spacing, and it is working fine now. I also placed it in the head.
One more question, since it is now in the head, can I also omit the comment code that prevents non-JS browsers from seeing it?
Thanks a bunch!
Ken
ps - thanks for the JS console tip, very helpful!!
I always use the comment marks, even in the head. The little bit of file size that might be saved isn't worth it. There's lots of browsers out there besides NN and MSIE -- you can't test on them all, so it's best to stay with the best practice standard.