link标签是同步加载还是异步加载


在HTML5规范中定义,  section of the HTML5 spec

User agents may opt to only try to obtain such resources when they are needed, instead of pro-actively fetching all the external resources that are not applied

 

The [<link>] element must delay the load event of the element's document until all the attempts to obtain the resource and its critical subresources are complete

 

也就是说 link的加载机制是由浏览器实现的,规范中并没有指明是同步还是异步,

但是能够保证的是 如果link没有加载完成,document.onload不会被触发

 
我们一般认为是 同步的


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM