Capture all events in BODY?

O

ohaya

Hi,

I'm trying to debug a problem with a page, and I was wondering if there was
any way to capture all events within a BODY? I don't know if this is
possible, but I was thinking of something like:

<BODY onEvent="mydebugfunction();">

In case you're wondering, what I'm trying to do is to determine what
event(s) are occurring with a certain combination of mouse events.

I know that this question is somewhat vague :(... My apologies.

Jim
 
M

Martin Honnen

ohaya wrote
I'm trying to debug a problem with a page, and I was wondering if there was
any way to capture all events within a BODY? I don't know if this is
possible, but I was thinking of something like:

<BODY onEvent="mydebugfunction();">

In case you're wondering, what I'm trying to do is to determine what
event(s) are occurring with a certain combination of mouse events.

I know that this question is somewhat vague :(... My apologies.

With IE4+, Netscape 6/7, Mozilla, Opera 7 you can use an event handler
for a certain event e.g. the mouseover event and handle that at the body
e.g.
<body onmouseover="mydebugfunction(event);">
If you want to handle other events too you need additional handlers e.g.
<body onmouseover="mydebugfunction(event);"
onmouseout="mydebugfunction(event);"
onmousemove="mydebugfunction(event);">

As for finding out which events exist a look at the relevant
documentation could help, for IE check out
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/events.asp
for Mozilla, Netscape 6/7, and Opera 7 check the HTML documentation for
the event handlers defined there and the W3C DOM Level 2 Events module,
both available on http://www.w3.org/
 
O

ohaya

Martin Honnen said:
ohaya wrote

With IE4+, Netscape 6/7, Mozilla, Opera 7 you can use an event handler
for a certain event e.g. the mouseover event and handle that at the body
e.g.
<body onmouseover="mydebugfunction(event);">
If you want to handle other events too you need additional handlers e.g.
<body onmouseover="mydebugfunction(event);"
onmouseout="mydebugfunction(event);"
onmousemove="mydebugfunction(event);">

As for finding out which events exist a look at the relevant
documentation could help, for IE check out
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/ref
erence/events.asp
for Mozilla, Netscape 6/7, and Opera 7 check the HTML documentation for
the event handlers defined there and the W3C DOM Level 2 Events module,
both available on http://www.w3.org/


Martin,

Thanks, it looks like the "onScroll" event will do it for me with IE. I'm
still trying to get a definitive answer (from my people) as to whether we
need to support Netscape (but I don't think so, since none of the machines
in our lab have it :().

Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top