文档: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属性返回与此属性相同的值。