|
|
|
|
| Advertise on this site |
John 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.
These do work.
Here is the
Amazing ,how can he do that!
I like this post. It help me
pretty! I wish you can keep
Thanks for sharing the post!
I can use it in
That's very nice plugin! I
These tips help me a lot!
Thanks for sharing the post!
Very good plugin! I like it!
Comments