XML DOM lookupNamespaceURI() 메서드
❮ 노드 객체
예시
다음 코드 조각은 " books_ns.xml "을 xmlDoc에 로드하고 지정된 "c" 접두사에 대한 네임스페이스 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 xmlDoc = xml.responseXML;
var x =
xmlDoc.getElementsByTagName("book")[0];
document.getElementById("demo").innerHTML =
x.lookupNamespaceURI("c");
}
산출:
https://www.w3schools.com/children/
정의 및 사용
lookupNameSpaceURI() 메서드는 지정된 접두사와 연결된 네임스페이스 URI를 반환합니다.
브라우저 지원
lookupNamespaceURI() 메서드는 모든 주요 브라우저에서 지원됩니다.
참고: Internet Explorer 9 및 이전 버전은 이 방법을 지원하지 않습니다.
통사론
nodeObject.lookupNamespaceURI(prefix)
매개변수
Parameter | Type | Description |
---|---|---|
prefix | String | Required. Specifies the prefix to look for |
반환 값
Type | Description |
---|---|
String | The namespace URI associated with the specified prefix |
기술적 세부 사항
DOM 버전 | 코어 레벨 3 노드 객체 |
---|
❮ 노드 객체