MimeTypeArray
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
Giao diện MimeTypeArray trả về một mảng các thể hiện MimeType, mỗi thể hiện chứa thông tin về một plugin trình duyệt được hỗ trợ. Đối tượng này được trả về bởi thuộc tính Navigator.mimeTypes đã lỗi thời.
Thuộc tính phiên bản
MimeTypeArray.lengthĐã lỗi thời-
Số lượng mục trong mảng.
Phương thức phiên bản
MimeTypeArray.item()Đã lỗi thời-
Trả về đối tượng
MimeTypevới chỉ số được chỉ định. MimeTypeArray.namedItem()Đã lỗi thời-
Trả về đối tượng
MimeTypevới tên được chỉ định.
Ví dụ
Ví dụ sau kiểm tra xem plugin có sẵn cho loại MIME 'application/pdf' không và nếu có, ghi lại mô tả của nó.
const mimeTypes = navigator.mimeTypes;
const pdf = mimeTypes.namedItem("application/pdf");
if (pdf) {
console.log(pdf.description);
}
Thông số kỹ thuật
| Thông số kỹ thuật |
|---|
| HTML> # mimetypearray> |