Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > setInterval Event object?

Reply
Thread Tools

setInterval Event object?

 
 
Richie
Guest
Posts: n/a
 
      12-07-2004
Is there a way to access an Event object associated with setInterval()?
I'm using Mozilla and Firefox on various platforms.
 
Reply With Quote
 
 
 
 
Daniel Kirsch
Guest
Posts: n/a
 
      12-07-2004
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
 
Reply With Quote
 
 
 
 
VK
Guest
Posts: n/a
 
      12-07-2004

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




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with setInterval(callserver,[period]) Felix Piskunov ASP .Net 1 11-06-2006 02:10 AM
Window.setInterval not working from asp.net barry ASP .Net 4 04-03-2005 04:55 PM
IE6: setInterval, this==window arrgh Richard A. DeVenezia Javascript 10 09-08-2003 02:14 AM
SetTimeout and SetInterval - since when? Robert Mark Bram Javascript 1 07-10-2003 02:15 AM
Using setInterval inside an object Daniel Javascript 28 07-05-2003 03:05 PM



Advertisments