XML DOM documentURI Özelliği
❮ Belge Nesnesi
Örnek
Aşağıdaki kod parçası, " books.xml " dosyasını xmlDoc'a yükler ve XML belgesinin konumunu görüntüler:
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 location: " + xmlDoc.documentURI;
}
Çıktı:
Document location: https://www.w3schools.com/xml/books.xml
Tanım ve Kullanım
DocumentURI özelliği, belgenin konumunu ayarlar veya döndürür.
Sözdizimi
documentObject.documentURI
❮ Belge Nesnesi