Capture all events in BODY?

Discussion in 'Javascript' started by ohaya, Apr 24, 2004.

  1. ohaya

    ohaya Guest

    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
     
    ohaya, Apr 24, 2004
    #1
    1. Advertising

  2. 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/


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Apr 24, 2004
    #2
    1. Advertising

  3. ohaya

    ohaya Guest

    "Martin Honnen" <> wrote in message
    news:408a57a5$...
    >
    >
    > 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/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
     
    ohaya, Apr 24, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Max
    Replies:
    7
    Views:
    9,125
  2. Chris

    Events Events Events Please Help

    Chris, Aug 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    373
    Chris
    Aug 30, 2005
  3. London Boy
    Replies:
    2
    Views:
    334
    Keith Bowes
    Jan 12, 2004
  4. Replies:
    5
    Views:
    212
    A. Sinan Unur
    Sep 8, 2005
  5. Cartoper

    HOWTO: capture onKeyUp on <body>

    Cartoper, Oct 30, 2007, in forum: Javascript
    Replies:
    1
    Views:
    91
    Bart Van der Donck
    Oct 30, 2007
Loading...

Share This Page