`
mr.a
  • 浏览: 93462 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

When is event DOMContentLoaded triggered

阅读更多

When is event DOMContentLoaded triggered?

DOMContentLoaded 何时触发?

 

Once the user agent stops parsing the document, the user agent must run the following steps:

当客户端停止解析文档后, 必须执行以下几步:


1. Set the current document readiness to “interactive” and the insertion point to undefined.

设置当前文档的状态为“inactive” 并设置插入点为 undefined。


Pop all the nodes off the stack of open elements.

 


2. If the list of scripts that will execute when the document has finished parsing is not empty, run these substeps:
2.1 Spin the event loop until the first script in the list of scripts that will execute when the document has finished parsing has its “ready to be parser-executed” flag set and the parser’s Document has no style sheet that is blocking scripts.
2.2 Execute the first script in the list of scripts that will execute when the document has finished parsing.
2.3 Remove the first script element from the list of scripts that will execute when the document has finished parsing (i.e. shift out the first entry in the list).
2.4 If the list of scripts that will execute when the document has finished parsing is still not empty, repeat these substeps again from substep 1.

3. Queue a task to fire a simple event that bubbles named DOMContentLoaded at the Document. 

 

分享到:
评论

相关推荐

    Javascript封装DOMContentLoaded事件实例

    主要介绍了Javascript封装DOMContentLoaded事件实例,DOMContentLoaded是FF,Opera 9的特有的Event, 当所有DOM解析完以后会触发这个事件,需要的朋友可以参考下

    JS兼容所有浏览器的DOMContentLoaded事件

    主要介绍了JS兼容所有浏览器的DOMContentLoaded事件的相关资料,标准浏览器中,使用DOMContentLoaded事件即可实现我们的要求,注册事件处理函数也极为简单,感兴趣的朋友一起学习吧

    domloaded检查何时加载DOM类似于DOMContentLoaded

    dom-loaded 检查何时加载DOM类似于`DOMContentLoaded`

    dom-loaded:检查DOM是否已像DOMContentLoaded一样加载

    加载了dom 检查DOM是否已像一样加载与DOMContentLoaded不同,这在加载DOM之后包含在内时也适用。安装$ npm install dom-loaded用法import domLoaded from 'dom-loaded' ;await domLoaded ;console . log ( 'The DOM ...

    JS、CSS以及img对DOMContentLoaded事件的影响

    最近在做性能有关的数据上报,发现了两个非常有意思的东西:Chrome开发者工具的Timeline分析面板,以及DOMContentLoaded事件。一个是强大的令人发指的性能分析工具,一个是重要的性能指标,于是就用Timeline对...

    关于HTML5+ API plusready的兼容问题

    3. 触发DOMContentLoaded事件 4. 注入5+ API 5. 触发plusready事件 这样导致5+ API生效时间比较延后,在html中引用js执行之后才能调用5+ API,通常采用以下代码调用5+ API: document.addEventListener('plusready'

    jquery中ready()函数执行的时机和window的load事件比较

    jquery的ready()实现的是 DOMContentLoaded 事件,DOMContentLoaded与window load事件的区别...// Handle when the DOM is ready ready: function() { // Make sure that the DOM is not already loaded if ( !jQuer

    ppts:performance-puppeteer-tests 一款页面性能检测工具

    点 基于node和puppeteer的Performance-puppeteer-tests尝试测量Web性能的指标,包括jsHeapUsedSize,... v1.4.0: Support webhook function when the outputFormat is json. v1.3.0: Change the methods of op

    Layar网络绩效预算「Layar Web Performance Budget」-crx插件

    用预算功能显示web性能的扩展(速度索引,DOMContentLoaded,时间到第一个字节) “ Layar Performance”预算会显示具有预算功能的网站性能(RUM速度指数,DOMContentLoaded和TTFB)。 此扩展将在您开发网站时为您提供...

    jsCalendar:Javascript驱动的事件日历

    addEventListener ( "DOMContentLoaded" , ( event ) => {calendar = new Calendar ( document . getElementById ( "calendar" ) , { } ) ;} ) ; 这应该在页面上显示日历,并应让您在几个月之间移动。 目前处于...

    你好,世界:普鲁巴·亨利

    函数eventListener(){document.addEventListener('DOMContentLoaded',preguntarPresupuesto);} formulario.addEventListener('submit', agregarGasto);//结束类Presupuesto {构造函数(presupuesto){this....

    littlepjs-文档-加载-nyc01-seng-ft-042020

    了解DOMContentLoaded为什么如此重要 在DOMContentLoaded上设置一个事件 介绍 使用JavaScript的重要部分是确保您的代码在正确的时间运行。 有时您可能不得不添加一些额外的代码,以确保您的代码在页面准备就绪之前...

    littlepjs-document-onload-dc-web-120919

    了解DOMContentLoaded为什么如此重要 在DOMContentLoaded上设置一个事件 介绍 使用JavaScript的重要部分是确保您的代码在正确的时间运行。 有时您可能不得不添加一些额外的代码,以确保您的代码在页面准备就绪之前...

    fewpjs-document-onload-rcdd_202104_tur_few

    了解DOMContentLoaded为什么如此重要 在DOMContentLoaded上设置一个事件 介绍 使用JavaScript的重要部分是确保您的代码在正确的时间运行。 有时您可能不得不添加一些额外的代码,以确保您的代码在页面准备就绪之前...

    littlepjs-文档-加载-nyc-web-080519

    在文档加载时加载JavaScript学习目标了解DOMContentLoaded为什么如此重要在DOMContentLoaded上设置一个事件介绍使用JavaScript的重要部分是确保您的代码在正确的时间运行。 有时您可能不得不添加一些额外的代码,以...

    somepjs-document-onload-dc-web-102819

    了解DOMContentLoaded为什么如此重要 在DOMContentLoaded上设置一个事件 介绍 使用JavaScript的重要部分是确保您的代码在正确的时间运行。 有时您可能不得不添加一些额外的代码,以确保您的代码在页面准备就绪之前...

    李克特React

    React李克特量表 ... addEventListener ( 'DOMContentLoaded' , ( ) => { const reviews = [ { question : 'Code is readable' } , { question : 'Tests are comprehensive' } , { question : 'Webpack is co

Global site tag (gtag.js) - Google Analytics