Order of execution of HTML,JAVASCRIPT.CSS in JSP pages

Source: Internet
Author: User
In fact, the browser load display HTML order is in the following order:
1, ie download the order is from top to bottom, rendering the order is from top to bottom, download and rendering is carried out at the same time.
2, when rendering to a part of the page, all the parts of it have been downloaded (not that all the associated elements have been downloaded).
3, if the semantic interpretation of the tag embedded file (JS script, CSS style), then IE download the process will enable a separate connection to download.
4, and in the download after parsing, parsing process, stop the page all down elements of the download.
5. After the download completes, the style sheet is parsed with all previously downloaded style sheets, and after parsing is completed, all previous elements (including previously rendered) are rendered again.
6, JS, CSS, if there is a redefinition, after the definition function will overwrite the function defined before.

If your page is larger, you want some content to show up first, stick to the viewer, then you can follow the rules of the above reasonable layout of your Web page, to achieve the intended purpose.

Http://www.cnblogs.com/EricaMIN1987_IT/p/3701025.html

1, domcontentloaded events to wait until all JS execution before triggering.

2, in the CSS before the jquery1.js a load is immediately executed. And in the CSS after the JS need to load the CSS after the implementation, For example, Jquery3.js was loaded early, but it did not execute until STYLE.CSS was loaded, and it was executed after jquery2.js execution, which was due to jquery3.js after jquery2.js. Although for modern browsers, these CSS, JS resources are concurrent requests (from send request can be seen).

Summary: Modern browsers will be concurrent preload CSS, JS, that is, the beginning of the concurrent request these resources, but, the implementation of the Order of CSS and JS or the original dependent order (JS execution to wait at its front of the CSS and JS loading, execution). Load the completed resource first, if its dependencies have not been loaded, finished, you can only wait.

Sequential execution, but generally CSS placed in front, JS in the end, which is conducive to the loading speed of the page, of course, there are special circumstances

Related Article

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.