Hi PC,
The "return false" cancels the user's click and prevents the normal navigation. Suppose you have this:
Code:
<a href="foo.htm" onclick="window.open('bar.htm')">click here!</a>
When you click on this link, two things happen. First, the popup window with bar.htm is opened. Second, the page you clicked on will navigate to foo.htm.
If you add in return false, only the first action (the popup window will take place) because the default behavior, which is to navigate to foo.htm, is cancelled:
Code:
<a href="foo.htm" onclick="window.open('bar.htm'); return false">click here!</a>
The important thing to realize is that the click event fires
before the regular navigation takes place.
Hope this helps.
Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/