XML DOM 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;
}
산출:
Document location: https://www.w3schools.com/xml/books.xml
정의 및 사용
documentURI 속성은 문서의 위치를 설정하거나 반환합니다.
통사론
documentObject.documentURI
❮ 문서 객체