XML DOM documentURI attribute

Document object reference manual

Definition and usage

The documentURI property can be set or returned to the location of the document.

Syntax:

documentObject.documentURI

Instance

In all examples, we will use the XML file books.xml, as well as the JavaScript function loadXMLDoc().

The following code snippet can display the location of the XML document:

xmlDoc=loadXMLDoc("/example/xdom/books.xml");
document.write("Document location: " + xmlDoc.documentURI);

Output:

Document location: http://www.codew3c.com/example/xdom/books.xml 

Document object reference manual