Topic awaiting preservation: objects, "this" and settimeout() (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: schillmania.com |
posted 01-19-2003 10:04
Recent posts on this stuff reminded me of something I've been wondering about. |
Maniac (V) Inmate From: Brisbane, Australia |
posted 01-19-2003 19:37
Lotta these questions going around as of late |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 01-19-2003 19:58
Nope the "this" in a setTimeout/setInterval doesn't work. There's no great solution for this, really... if it took a function as its argument rather than a string, it could be done somehow probably... but I don't know of an easy way. I rarely use setTimeouts that extensively. |
Paranoid (IV) Inmate From: France |
posted 01-19-2003 21:10
Scott: I've been puzzled too by the fact that the setTimeout function is only available on the window object. So I throw the following piece of code : code: function evalSetTimeout( evalString, delay )
|
Maniac (V) Mad Scientist From: New California |
posted 01-19-2003 23:30
I've been using the setTimeout within objects for quite a while now and I had always made the object name a member of the object that needed a setTimeout. Then I just called the timer using that. I have looked for alternatives for this and have not found any. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 01-20-2003 01:06
I got a line from bratta a long time ago |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 01-20-2003 01:49
Clever. With that, you only need to find a separate ID string for each object. |