setInterval Event object?

Discussion in 'Javascript' started by Richie, Dec 7, 2004.

  1. Richie

    Richie Guest

    Is there a way to access an Event object associated with setInterval()?
    I'm using Mozilla and Firefox on various platforms.
     
    Richie, Dec 7, 2004
    #1
    1. Advertising

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


    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(function() { alert(e.type); },1000);
    }

    Daniel
     
    Daniel Kirsch, Dec 7, 2004
    #2
    1. Advertising

  3. Richie

    VK Guest


    > Is there a way to access an Event object associated with setInterval()?


    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."
     
    VK, Dec 7, 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. barry
    Replies:
    4
    Views:
    3,813
    barry
    Apr 3, 2005
  2. Felix Piskunov

    Problem with setInterval(callserver,[period])

    Felix Piskunov, Nov 5, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    453
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Nov 6, 2006
  3. Daniel

    Using setInterval inside an object

    Daniel, Jun 30, 2003, in forum: Javascript
    Replies:
    28
    Views:
    426
    Daniel
    Jul 5, 2003
  4. Robert Mark Bram

    SetTimeout and SetInterval - since when?

    Robert Mark Bram, Jul 10, 2003, in forum: Javascript
    Replies:
    1
    Views:
    126
    Lasse Reichstein Nielsen
    Jul 10, 2003
  5. marktm
    Replies:
    6
    Views:
    165
    Richard Cornford
    May 13, 2005
Loading...

Share This Page