XML DOM documentURI 属性
定義と用法
documentURI
属性を設定またはドキュメントの場所を返します。
構文
documentObject.documentURI
例
以下のコードは「books.xml」を xmlDoc に読み込み、XML ドキュメントの場所を表示します:
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 = "Document location: " + xmlDoc.documentURI; }