|
|
|
|
| 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.
123213
Is there a widget for blogger
Excellent Posting, Great
hi admin . i think this post
cancel pitiable
eliminate see
Awesome Awesome Awesome!!!!!
Hi All,
THis is the very
Wichita
Nice collections!
hi buddy,
I want to this
Comments