setInterval Event object?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richie

    setInterval Event object?

    Is there a way to access an Event object associated with setInterval()?
    I'm using Mozilla and Firefox on various platforms.
  • Rob B

    #2
    Re: setInterval Event object?


    Event objects are associated with....events. setInterval is a function.

    Mozilla browsers manage the Event object as a handable object, passed
    automatically to any assigned handler function (as arguments[0]).

    Might need to explain your specific problem.

    The MDN Web Docs site provides information about Open Web technologies including HTML, CSS, and APIs for both Web sites and progressive web apps.



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!

    Comment

    • Daniel Kirsch

      #3
      Re: setInterval Event object?

      Richie wrote:[color=blue]
      > Is there a way to access an Event object associated with setInterval()?
      > I'm using Mozilla and Firefox on various platforms.[/color]

      You may pass a function instead of a string to setInterval or
      setTimeout. You may then use the closure to access variables defined in
      the original function.
      However, this one caused problems on IE 5.0 in some testcases.

      function clickHandler(e) {
      e = e || window.event;
      setTimeout(func tion() { alert(e.type); },1000);
      }

      Daniel

      Comment

      • VK

        #4
        Re: setInterval Event object?

        [color=blue]
        > Is there a way to access an Event object associated with setInterval()?[/color]

        You mean something like "Timer Interruption" IRQ?
        No, such event is not defined neither in JavaScript, nor JScript.

        Access to timers is a part of security model. The underlying logic is: "If
        it's
        your timer, you can code it in the way you want. If you cannot reach the
        timer, so it's not your timer, so it's not up to you to handle it."




        Comment

        Working...