RobG said the following on 12/29/2005 7:58 AM:[color=blue]
> jitendramr wrote:
>[color=green]
>> Thanks all for a very prompt reply!
>>
>> : (
>>
>> 1. Actually i m not worried about javascript blocking as Javascript is
>> a prerequieist for my application. So the user is aware of this.
>> 2. I cant use '#' as IE will treat it as a page location and scroll up
>> the page to the top.[/color]
>
>
> Hence the suggestion to use - return false - in the onclick, it will
> stop the browser following the link (i.e. in this case, going to the top
> of the page).
>
>[color=green]
>> 3. i am not using any server side at this level as this only requires
>> to open another html page a new window....
>>
>> : )
>> 4. I can use 'href=somepage.html' (but i m doubtful of any flickering
>> as we are calling 2 pages - 1 on href and 2 onClick, pls correct me)[/color]
>
>
> If you use return false the HREF will not be followed regardless of what
> you put in there. Just don't use javascript
:void().[/color]
<a href="somePage.html" onclick="return openWindow('this.href')">
function openWindow(newURL){
....
return false
}
Then, if anything in the function errors, the normal navigation takes
place. It is even a good practice when creating links with script. It
allows *something* to happen even when something breaks.
--
Randy
comp.lang.javascript FAQ -
http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/