Priority Hints & fetchPriority property All In One
Priority Hints & fetchPriority property All In One
试验性功能 ⚠️
https://caniuse.com/?search=fetchPriority
Priority Hints
优先级 / 性能优化
https://web.dev/priority-hints/
supported elements:
img
(含 picture ),link
,script
andiframe
https://wicg.github.io/priority-hints/#img
fetchPriority
APIs
const img = new Image();
img.fetchPriority = 'high';
img.src = 'img/logo.png';
https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/fetchPriority
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-fetchpriority
demos
img height
/* height 无单位 */
<img src="https://img2020.cnblogs.com/blog/740516/202010/740516-20201020150243125-1990361642.png" height="400">
// 或
/* style height 有单位 */
<img src="https://img2020.cnblogs.com/blog/740516/202010/740516-20201020150243125-1990361642.png" style="height: 400px">
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-height
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading
(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!
refs
https://www.cnblogs.com/xgqfrms/p/13818745.html#5142396
©xgqfrms 2012-2021
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/17061059.html
未经授权禁止转载,违者必究!