HighDots Forums  

setTimeout("thread(obj)",0)

Javascript JavaScript language (comp.lang.javascript)


Discuss setTimeout("thread(obj)",0) in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
gert
 
Posts: n/a

Default setTimeout("thread(obj)",0) - 12-14-2007 , 09:08 PM






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

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

Reply With Quote
  #2  
Old   
Peter Michaux
 
Posts: n/a

Default Re: setTimeout("thread(obj)",0) - 12-14-2007 , 09:36 PM






On Dec 14, 7:08 pm, gert <gert.cuyk... (AT) gmail (DOT) com> wrote:
Quote:
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


Reply With Quote
  #3  
Old   
gert
 
Posts: n/a

Default Re: setTimeout("thread(obj)",0) - 12-14-2007 , 10:23 PM



On Dec 15, 4:36 am, Peter Michaux <petermich... (AT) gmail (DOT) com> wrote:
Quote:
On Dec 14, 7:08 pm, gert <gert.cuyk... (AT) gmail (DOT) com> wrote:

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


Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.