Article ID: 190244
Article Last Modified on 8/8/2007
<A HREF="#" onclick="window.location.href='http://www.microsoft.com';">
problem repro </A>
window.event.returnValue = false;This causes the onclick event to fire and not try to navigate to the HREF specified by the link.
style="cursor:hand; text-decoration:underline; color:blue; font-family:times new roman"
<HTML> <HEAD> <TITLE> title </TITLE> </HEAD> <BODY> <A HREF="#" onclick="window.location.href='http://www.microsoft.com';"> problem repro </A> <br> <A HREF="#" onclick="window.location.href='http://www.microsoft.com'; window.event.returnValue=false;"> solution 1: add window.event.returnValue=false statement</A> <br> <A HREF="JavaScript:window.location.href='http://www.microsoft.com';"> solution 2: replace HREF value with JavaScript:[code] </A> <br> <A onclick="window.location.href='http://www.microsoft.com';" onmouseover="window.status='http://www.microsoft.com';" onmouseout="window.status='';" style="cursor:hand; text-decoration:underline; color:blue; font-family:times new roman"> solution 3: remove HREF attribute and use CSS </A> </BODY> </HTML>
Keywords: kbbug kbhtml kbprb kbscript KB190244