X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML DOM documentURI Property

Document Object Reference Document Object

Example

Get the location URI of the document:

var x = document.documentURI;

The result of x will be:

http://www.w3schools.com/jsref/prop_document_documenturi.asp

Try it yourself »


Definition and Usage

The documentURI property sets or returns the location of a document.

If the document was created by the DocumentImplementation object, or if it is undefined, the return value is null.

Tip: Unlike the document.URL property, the documentURI property can be used on any document types, whereas URL can only be used on HTML documents.


Browser Support

Property
documentURI Yes Not supported Yes Yes Yes


Syntax

Return the documentURI property:

document.documentURI

Set the documentURI property:

document.documentURI=locationURI

Technical Details

Return Value: A String, representing the URI of the document
DOM Version Core Level 3 Document Object


Document Object Reference Document Object


Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook