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刪除。



猜您在找 html預加載之link標簽 javascript 同步加載與異步加載 HTML頁面加載和解析流程 link與script標簽 HTML 標簽 react的Link標簽 同步和異步 什么是異步和同步 頁面中