Atrybut baseURI DOM XML

Definicja i zastosowanie

baseURI Atrybut zwraca absolutny URI węzła.

Gramatyka

nodeObject.baseURI

Szczegółowe informacje techniczne

Zwrócona wartość: Ciąg znaków, który reprezentuje absolutny URI węzła.
Wersja DOM: Obiekt węzła poziomu 3 Core

Przykład

Poniższy kod ładuje \

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 += \
    {}
    document.getElementById("demo").innerHTML = txt;
{}

Spróbuj sam

Wsparcie przeglądarek

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Wspierane Wspierane Wspierane Wspierane Wspierane

Wszystkie główne przeglądarki wspierają to baseURI Atrybuty, z wyjątkiem Internet Explorer.