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