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