🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: it.comp.lang.javascript
1 messages
1 total messages Started by zoltix Thu, 20 Jan 2005 16:37
I would like to intercept all click events on my document.
#1
Author: zoltix
Date: Thu, 20 Jan 2005 16:37
27 lines
2093 bytes
Hi,

I am beginner in JavaScript.   I would like to intercept all click 
events on my document.   I use this function for that 
document.onmousedown=click;.   It works well.   But I would like to 
continue the execution code on a other button or anything else.


Example
1)	Click anywhere intercept click->Execute the code in function click().
2)	Click on a link�.   intercept click -> Execute the code in function 
click() ->Load the link(http://test.html)
3)	Click on a button� intercept click-> Execute the code in function 
click() ->Execute the code for the button(submit, or other javascript)
				

Thank a lot for your help�



function click() {
if (event.button==1) {	
alert(�Test event�)
//execute before�.ex close all div
}
  //Here continue code
}
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads