XML DOM » Document » url

Compability: Internet Explorer

Syntax:
document.url

This property contains the canonicalized URL for the last loaded XML document.

If the document is being built in memory, it returns null. The url property is not updated after saving a document using the save method; to do this, reload the document with the load method.

Examples

Code:
xml_doc = new ActiveXObject("Microsoft.XMLDOM");
xml_doc.async = false;
xml_doc.load("staff.xml");
document.write(xml_doc.url);
Output:
http://www.devguru.com/somedir/staff.xml
Explanation:

This code loads the 'staff.xml' file and displays its url.

Language(s): JavaScript