XML DOM lookupPrefix() နည်းလမ်း
❮ Node Object
ဥပမာ
အောက်ဖော်ပြပါ ကုဒ်အပိုင်းအစသည် " books_ns.xml " ကို xmlDoc တွင် တင်ပြီး ပေးထားသည့် namespace URI အတွက် ရှေ့ဆက်ကို ရှာသည်-
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.lookupPrefix("https://www.w3schools.com/children/");
}
အထွက်-
c
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
lookupPrefix() နည်းလမ်းသည် ပေးထားသော namespace URI နှင့်ဆက်စပ်နေသော ရှေ့ဆက်ကို ပြန်ပေးသည်။
Browser ပံ့ပိုးမှု
lookupPrefix() နည်းလမ်းကို အဓိက ဘရောက်ဆာအားလုံးတွင် ပံ့ပိုးထားသည်။
မှတ်ချက်- Internet Explorer 9 နှင့် အထက်တွင် ဤနည်းလမ်းကို မပံ့ပိုးပါ။
အထားအသို
nodeObject.lookupPrefix(namespaceURI)
ကန့်သတ်ချက်များ
Parameter | Type | Description |
---|---|---|
namespaceURI | String | Required. Specifies the namespace URI to look for |
တန်ဖိုးကို ပြန်ပေးသည်။
Type | Description |
---|---|
String | The prefix associated with the specified namespace URI |
နည်းပညာဆိုင်ရာအသေးစိတ်
DOM ဗားရှင်း | Core Level 3 Node Object |
---|
❮ Node Object