Document: thuộc tính documentURI
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2018.
Thuộc tính chỉ đọc documentURI của giao diện Document trả về vị trí của tài liệu dưới dạng một chuỗi.
Giá trị
Một chuỗi.
Ví dụ
>JavaScript
js
document.getElementById("url").textContent = document.documentURI;
HTML
html
<p id="urlText">
URL:<br />
<span id="url">URL goes here</span>
</p>
Kết quả
Đặc tả kỹ thuật
| Thông số kỹ thuật |
|---|
| DOM> # ref-for-dom-document-documenturi①> |
Tương thích trình duyệt
Xem thêm
- Thuộc tính
document.URLtrả về cùng giá trị.