Alert interrupts the settimeout timer function _ javascript skills
Source: Internet
Author: User
During the test, it is found that alert will interrupt the timer function of settimeout. After the dialog box is closed, the time of settimeout starts to be timed again, instead of from the break, if you are interested, you can learn that alert will interrupt the timer function of settimeout. After the dialog box is closed, the time of settimeout starts to start timing again, rather than from the center.
For example, if settimeout is set to 5 minutes later, but after 3 minutes, alert is displayed. After alert is disabled, settimeout starts timing again and waits for 5 minutes instead of 2 minutes.
In addition, as long as it is within the same browser window, alert will interrupt settimeout in other frames even in different frames,
Why is it because javascript is single-threaded?
This is found in IE browser. I have not tested other dialogs and pop-up boxes.
I really hope html5 will become more popular soon, and the multi-thread function will be enough.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.