文件:documentURI 屬性
documentURI 是 Document 介面的一個只讀屬性,它返回文件的位置(URI)字串。
值
字串。
示例
JavaScript
js
document.getElementById("url").textContent = document.documentURI;
HTML
html
<p id="urlText">
URL:<br />
<span id="url">URL goes here</span>
</p>
結果
規範
| 規範 |
|---|
| DOM # ref-for-dom-document-documenturi① |
瀏覽器相容性
載入中…
另見
document.URL屬性返回與此屬性相同的值。