473,386 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

setTimeout("thread(obj)",0)

is there any way i can make setTimeout work with a private obj ?

function() {
var obj
setTimeout("thread(obj)",0)
}
Dec 15 '07 #1
2 1730
On Dec 14, 7:08 pm, gert <gert.cuyk...@gmail.comwrote:
is there any way i can make setTimeout work with a private obj ?

function() {
var obj
setTimeout("thread(obj)",0)

}
You can send a function as the first argument to setTimeout. This
function's closure will contain obj.

function() {
var obj;
setTimeout(function(){thread(obj);},0);
}

Peter
Dec 15 '07 #2
On Dec 15, 4:36 am, Peter Michaux <petermich...@gmail.comwrote:
On Dec 14, 7:08 pm, gert <gert.cuyk...@gmail.comwrote:
is there any way i can make setTimeout work with a private obj ?
function() {
var obj
setTimeout("thread(obj)",0)
}

You can send a function as the first argument to setTimeout. This
function's closure will contain obj.

function() {
var obj;
setTimeout(function(){thread(obj);},0);

}
Thank you very much :)
Dec 15 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.