timer - delay closing window javascript -


i writing google chrome extension. here putting silly-assed questions. routine primitive runs fine. problem runs fast overloads server , ip address gets blocked. needs throttle.

the question whether better construct timer or setinterval. after examining particular page, content script closes window self.close(). if put setinterval, delay closing of page , slow whole process as length of interval. seems throttle.

now last line of content script simply:

self.close(); 

i presume if modify code follows delay:

var t=settimeout("self.close()",2000); 

will work? there better way it?

i'd rather use :

settimeout(function(){     self.close(); },2000); 

but way valid too...


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -