Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: SV: captureEvents and clickHandler(e)


Message #1 by "Robert Nyman" <robert.nyman@c...> on Fri, 22 Nov 2002 11:26:07 +0100
Is this just code for Netscape 4?
Because captureEvents is Netscape 4 specific...

Anyway, what I think has to be changed to make it work
(I only use one event handler here, to avoid the possibility that the
function will be called several times):

<html>
<head>
	<script language=3D"JavaScript" type=3D"text/javascript">
		document.captureEvents(Event.CLICK);	=09
		document.onclick =3D clickHandler;
		function clickHandler(e){
			if(window.newwin){
				alert("Click event caught");
				return false;
			}=09
		}=09
	</script>
</head>

<body>


</body>
</html>


/Robert


-----Ursprungligt meddelande-----
Fr=E5n: arsal01@h... [mailto:arsal01@h...]
Skickat: den 21 november 2002 20:24
Till: javascript
=C4mne: [javascript] captureEvents and clickHandler(e)


Hi

I couldnt capture event and then handle it properly:
This is my code

<body onfocus=3D"if (window.newwin) ClosingOption();" onclick=3D"if
(window.newwin) ClosingOption();">


function ClosingOption() {
window.captureEvents(Event.CLICK | Event.FOCUS); 
}

function clickHandler(e) {
  alert("Click event caught");
  return false;
}

any clue ....?

Thanks in advance
Arsalan


  Return to Index