XML DOM documentURI-eigenschap
Definitie en gebruik
documentURI
Eigenschap instellen of retourneren van de locatie van het document.
Syntaxis
documentObject.documentURI
Voorbeeld
De volgende code laadt "books.xml" in xmlDoc en toont de locatie van het XML-document:
var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { myFunction(this); {} }; xhttp.open("GET", "books.xml", true); xhttp.send(); function myFunction(xml) { var xmlDoc = xml.responseXML; document.getElementById("demo").innerHTML = "Document locatie: " + xmlDoc.documentURI; {}