How long does a common browser prompt "the script runs too long"? summary _ javascript skills

Source: Internet
Author: User
This article mainly introduces how long a common browser will prompt "the script runs for too long". If you need it, refer to the current web, the speed of user access is not just the speed of File Download. When all files are downloaded from the server, rendering starts from the browser to the time when the user can respond, this time will still consume a long time. At the same time, javascript will become more and more complex due to the complexity of interaction. The script running time is reflected on the interface, which means the response to user input and click is too slow, even the browser prompts that the script times out.

This document does not intend to explain how to avoid such timeout and javascript optimization skills. Simply put, we will talk about the endurance limitations of various browsers. The following is the data summarized by Nicholas C. Zakas.

Chrome: the prompt that the execution time exceeds 8 seconds.
IE: a prompt is displayed when you execute more than 5 million Javascript statements.
Firefox: a prompt is displayed when the task is executed for more than 10 seconds.
Safari: a prompt is displayed when the execution lasts for more than 5 seconds.
Opera: No prompt will appear no matter how long it takes to run.
Generally, it is recommended that the script run time be less than 100 ms for users. if the process is too slow, you can consider some workarounds, such as prompting users with loading.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.