HTMLLinkElement: thuộc tính fetchPriority
Baseline
2024
Newly available
Since October 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
Thuộc tính fetchPriority của giao diện HTMLLinkElement đại diện cho một gợi ý gửi đến trình duyệt về cách ưu tiên tải một tài nguyên cụ thể so với các tài nguyên khác cùng loại.
Nó phản ánh thuộc tính nội dung fetchpriority của phần tử <link>.
Giá trị
Một chuỗi. Các giá trị được phép, xem thuộc tính HTML fetchpriority.
Ví dụ
js
const preloadLink = document.createElement("link");
preloadLink.href = "my-image.jpg";
preloadLink.rel = "preload";
preloadLink.as = "image";
preloadLink.fetchPriority = "high";
document.head.appendChild(preloadLink);
Đặc tả kỹ thuật
| Thông số kỹ thuật |
|---|
| HTML> # dom-link-fetchpriority> |
Trình duyệt hỗ trợ
Xem thêm
HTMLImageElement.fetchPriorityHTMLScriptElement.fetchPriority- Tiêu đề HTTP
Link - Tối ưu hóa việc tải tài nguyên với Fetch Priority API để biết thông tin về cách API này ảnh hưởng đến mức ưu tiên trên Chrome.