XML DOM aramasıNamespaceURI() Yöntemi
❮ Düğüm Nesnesi
Örnek
Aşağıdaki kod parçası, " books_ns.xml " dosyasını xmlDoc'a yükler ve verilen "c" öneki için ad alanı URI'sini bulur:
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
myFunction(this);
}
};
xhttp.open("GET", "books_ns.xml", true);
xhttp.send();
function myFunction(xml) {
var xmlDoc = xml.responseXML;
var x =
xmlDoc.getElementsByTagName("book")[0];
document.getElementById("demo").innerHTML =
x.lookupNamespaceURI("c");
}
Çıktı:
https://www.w3schools.com/children/
Tanım ve Kullanım
lookupNameSpaceURI() yöntemi, belirli bir önekle ilişkili ad alanı URI'sini döndürür.
Tarayıcı Desteği
lookupNamespaceURI() yöntemi, tüm büyük tarayıcılarda desteklenir.
Not: Internet Explorer 9 ve önceki sürümleri bu yöntemi desteklemez.
Sözdizimi
nodeObject.lookupNamespaceURI(prefix)
parametreler
Parameter | Type | Description |
---|---|---|
prefix | String | Required. Specifies the prefix to look for |
Geri dönüş değeri
Type | Description |
---|---|
String | The namespace URI associated with the specified prefix |
Teknik detaylar
DOM Sürümü | Çekirdek Düzey 3 Düğüm Nesnesi |
---|
❮ Düğüm Nesnesi