XML DOM implementation 屬性

定義和用法

implementation 屬性返回處理文檔的 DOMImplementation 對象。

語法

documentObject.implementation

實例

下面的代碼將 "books.xml" 加載到 xmlDoc 中,并返回處理該文檔的 DOMImplementation 對象:

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 =
    xmlDoc.implementation;
}

親自試一試