Document 接口的属性 documentURI 以字符串的形式返回文档的位置(location)。
 
在最初的DOM3定义中,这个属性是可读/写的。在现代的DOM标准(DOM4)中,它是只读的。
 

语法

var string = document.documentURI;

备注

HTML 文档有一个 document.URL 属性返回同样的值。但是不像 URLdocumentURI 适用于所有类型的文档。

规范

Specification Status Comment
DOM
documentURI
Living Standard  
Document Object Model (DOM) Level 3 Core Specification
documentURI
Obsolete Initial definition

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support YesEdge ? Firefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?
Read-only behaviorChrome Full support 43Edge ? Firefox Full support YesIE No support NoOpera Full support 30Safari No support NoWebView Android Full support 43Chrome Android Full support 43Edge Mobile ? Firefox Android Full support YesOpera Android Full support 30Safari iOS No support NoSamsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

文档标签和贡献者

标签: 
此页面的贡献者: aronlee, lext, teoli, ziyunfei, AlexChao
最后编辑者: aronlee,