HTML DOM documentURIProperty

Document 对象参考手册Document Object

Example

Get the document's local URI:

document.documentURI;

Output:

http://www.w3cschool.cc/jsref/prop-document-documenturi.html

Try it yourself »

Definition and Usage

The documentURI property can set or return the location of a document.

If the document was created by a DocumentImplementation object, or if it is not defined, returnsnull。


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All browsers support the documentURI property except Internet Explorer.


Syntax

Set the documentURI of a document:

document.documentURI=locationURI

Return the documentURI:

document.documentURI

Technical Details

Return value: A string, representing the URI of the document.
DOM Version Core Level 3 Document Object


Document 对象参考手册Document Object

Other Extensions