homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

location.replace not working in netscape
is my code ok?

 8:59 pm on Nov 15, 2000 (gmt 0)

I am using the following to redirect some of my pages:

<SCRIPT language="JavaScript1.1">

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.



 11:40 pm on Nov 15, 2000 (gmt 0)

Hi drastic,

The final line:
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.


 7:19 pm on Nov 16, 2000 (gmt 0)

Thanks tedster!

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!

ps - thanks for the JS console tip, very helpful!!


 7:45 pm on Nov 16, 2000 (gmt 0)

I'm glad it's fixed, drastic. Javascript debugging can get you talking to the walls sometimes.

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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved