XML DOM အခြေခံURI ပိုင်ဆိုင်မှု
❮ Node Object
ဥပမာ
အောက်ပါ ကုဒ်အပိုင်းအစသည် " books_ns.xml " ကို xmlDoc သို့ တင်ပြီး <title> ဒြပ်စင်များ၏ အခြေခံ 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
x, i, xmlDoc, txt;
xmlDoc = xml.responseXML;
txt = "";
x = xmlDoc.getElementsByTagName("title");
for (i = 0; i <
x.length; i++) {
txt +=
"Base URI: " + x.item(i).baseURI + "<br>";
}
document.getElementById("demo").innerHTML = txt;
}
အထက်ဖော်ပြပါ ကုဒ်၏ အထွက်သည်-
Base URI: https://www.w3schools.com/xml/books_ns.xml
Base URI:
https://www.w3schools.com/xml/books_ns.xml
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
baseURI ပိုင်ဆိုင်မှုသည် node တစ်ခု၏ absolute base URI ကို ပြန်ပေးသည်။
Browser ပံ့ပိုးမှု
BaseURI ပိုင်ဆိုင်မှုကို Internet Explorer မှလွဲ၍ အဓိကဘရောက်ဆာများအားလုံးတွင် ပံ့ပိုးထားသည်။
အထားအသို
nodeObject.baseURI
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | node တစ်ခု၏ absolute base URI ကို ကိုယ်စားပြုသည့် စာကြောင်း |
---|---|
DOM ဗားရှင်း | Core Level 3 Node Object |
❮ Node Object