domcontentloaded event of js/css/img loading sequence relation

Source: Internet
Author: User

domcontentloaded Introduction

The trigger condition for the domcontentloaded event is:

Will be triggered after all the DOM is loaded and the JS load executes.

But if "JS is dynamically loaded in, it will not affect the domcontentloaded trigger time"

As shown in the following figure, the Blue line represents domcontentloaded start, but only if JS has been loaded and executed.

(Just Dom is not the OnLoad event the entire page loaded complete trigger, domcontentloaded than the onload before the trigger please separate, onload for the red line means that the page has been loaded complete)

What do img and CSS do before domcontentloaded triggers?

It says that before the domcontentloaded trigger, JS has been executed.

But what about IMG and CSS? Let's look at the picture below: The domcontentloaded event was triggered, but some of the pictures were blocked.

Blocking is also meant to be delayed loading by the browser, although the picture request was sent out early.

But browsers think that your CSS is not loaded, not sure how the style of the picture, involved in redrawing the resource problem.

Back to the column page: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/script/

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.