a function
Http://www.cnblogs.com/xieex/archive/2008/07/11/1241151.html
Often see setTimeout delay 0ms JavaScript code, feel very confused, is it not a delay of 0ms and no delay is not a reason?
A delay of 0 seconds can break the function execution out of the current environment:
When an event occurs, its associated action is not completed.
So:
The characters entered here are not available in the 1 KeyPress event and can only be obtained from the previous
In the 2 radio click event, it is not possible to get a click here to select the radio, but to get the status before the click.
Workaround: While using SetTimeout, even 0 seconds can be removed from the current event, you can get the status after the end of the current event .
$ (' Radio '). On (' tap ',function() { /// Here you can only get the status of Radio before clicking . }); $ (' Radio '). On (' tap ',function() { setTimeout (funnction ()} {// can get the status after click },0);});
Two questions
Http://www.cnblogs.com/fullhouse/archive/2012/10/10/2718542.html
Can not be true 0 seconds, but 16ms or so, Chrome,ie10 and other browsers, settimeout interval shortened to 4MS.
SetTimeout delay 0 milliseconds of function and problem