모든 개체를 가져 오려고하는데 작동하지 않습니다.JavaScript : document.evaluate()를 반복하다 XPathResult가 null을 반환합니다.
var tmp = document.evaluate("//tr", document, null, XPathResult.ANY_TYPE, null);
tmp.iterateNext
답장 null;
모든 개체를 가져 오려고하는데 작동하지 않습니다.JavaScript : document.evaluate()를 반복하다 XPathResult가 null을 반환합니다.
var tmp = document.evaluate("//tr", document, null, XPathResult.ANY_TYPE, null);
tmp.iterateNext
답장 null;
IE에서 작업하는 경우 여기 document.evaluate
이 존재하지 않아야합니다 (this similar question 및 the last couple of paragraphs here 참조).
왜 document.getElementsByTagName("tr");
이 아닌가요?
제 생각에는 JQuery와 같은 기존 JS 라이브러리를 사용하는 것이 일반적으로 이와 같은 경우 신뢰할 수 있습니다.
document.getElementsByTagName("tr");
IE 버전은 '이름'과 같은 속성이없는 요소에 대해이 방법을 지원하지 않기 때문에 또한 작동하지 않습니다.