Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using captureEvents and location.href on the same page.

Status
Not open for further replies.

tleish

Programmer
Jan 17, 2001
619
US
How do you get a captureEvents and location.href to work on the same page using and OnClick event on a link. It appears that the captureEvents prevents locaiton.href to be executed.

Basic Example:
<html>
<head>
<title>Test</title>
<script language=&quot;Javascript&quot;>
<!--
function clickHandler(){
alert(&quot;OnClick Captured&quot;);
}

document.onclick = clickHandler;
if (document.layers) document.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP | Event.MOUSEMOVE);

function redirectPage(){
location.href = ' }

//-->
</script>
</head>

<body bgcolor=&quot;#FFFFFF&quot;>

<A href=&quot;JavaScript:void(0)&quot; onClick=&quot;redirectPage()&quot;>Test</A>

</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top