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不会被触发

 
我们一般认为是 同步的
posted @ 2020-06-17 21:38  hh9515  阅读(1632)  评论(0)    收藏  举报