The documentURI property of the Document interface returns the document location as a string.
As originally defined in DOM3 this attribute read/write. In the modern DOM Standard it is read only.
var string = document.documentURI;
HTML documents have a document.URL property which returns the same value. Unlike URL, documentURI is available on all types of documents.
| Specification | Status | Comment |
|---|---|---|
| DOM The definition of 'documentURI' in that specification. | Living Standard | |
| Document Object Model (DOM) Level 3 Core Specification The definition of 'documentURI' in that specification. | Obsolete | Initial definition |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | Yes | ? | Yes | Yes | Yes | Yes |
| Read-only behavior | 43 | ? | Yes | No | 30 | No |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | Yes | Yes | ? | Yes | Yes | Yes | ? |
| Read-only behavior | 43 | 43 | ? | Yes | 30 | No | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/document/documentURI