XML DOM baseURIProperty
Element object
Definition and Usage
The baseURI property returns the location (URI) of the XML document.
Syntax
elementNode.baseURI
Example
The following code snippet usesloadXMLDoc()put "books.xml"Load into xmlDoc, and display the location of the XML document:"
Example
xmlDoc=loadXMLDoc("books.xml");
x=xmlDoc.getElementsByTagName("book")[0];
document.write("Document location: " + x.baseURI);
x=xmlDoc.getElementsByTagName("book")[0];
document.write("Document location: " + x.baseURI);
Output:
Document location: https://www.example.com/try/demo_source/books.xml
Try it Yourself »
Element objectother extensions