PDA

View Full Version : trouble understanding redirect link



changintimes
30 Aug 2006, 11:45 PM
new to javascript.........

can somebody help me with this javascript example from my book ?

the following link uses javascript to redirect the user to another page, the user may go to a page via the typical HTML link or through the onclick, javascript command, ( i realize this may be a very common type of link with javascript ), depending on if the user has an old browser or a new one:

<a href="script04.html" onclick="window.location='jswelcome.html';return false">Welcome to our site... c'mon in!</a>

i know the "return false" command is executed if the user has a new browser, but i don't understand why the "return false" command does not also return false the "window.location='jswelcome.html'" command,

Fantasiser
22 Sep 2006, 08:22 AM
are you trying to open the website in a new window?? If so, why not use the HTML code target="_blank" ?? this opens it in a new window too