setInterval Event object?

R

Richie

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

Daniel Kirsch

Richie said:
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
 
V

VK

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."
 

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

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top