|
|
|
|
| Advertise on this site |
Timer and Interval OffsetJohn Resig continues to explore the timer objects in JavaScript language, this time he write:
«ome Archives Projects About Me
John Resig
Contact, Subscribe
Timer and Interval Offset
I've got another crazy-weird setTimeout/setInterval behavior that you may not know about. However, unlike my previous discovery, this one may actually be useful.
Observe the following, seemingly innocuous, code:
var count = 0;
var interval = setInterval(function(off){
document.body.innerHTML += " " + off;
if ( ++count == 10 )
clearInterval( interval );
}, 100);
In particular pay attention to the use of the first argument within the callback function. Running this code in any browser, but a Mozilla based one, will give you the expected "undefined undefined undefined ...".»
You can read the full version of article in John Resig blog.
http://ubog.co.nr the best
Before you say something
Excellent collection!
I am using the one-way link
Awesome list
Thank you
there so many blog but above
Thansk admin..Very good site
I already created a working
Great selection. Perhaps if
Comments