4번독수리의 둥지
IE has a problem replacing TBODY contents with innerHTML. 본문
IE has a problem replacing TBODY contents with innerHTML. The jQuery given above works; if you are not using jQuery, another solution is to have a <div id='helper' style='visibility:hidden'/>
somewhere in the page - when the response arrives, put the value with a surrounding <table>
tag into the hidden div, then use the DOM to remove the old contents from your visible tag and insert the elements from the hidden tag 1 by 1:
var a=document.getElementById("dealdata");
while(a.firstChild!=null)
a.removeChild(a.firstChild);
var b=document.getElementById("helper");
b.innerHTML="<table>"+this.responseText+"</table>";
while(b.tagName!="TR") {
if(b.tagName==null)
b=b.nextSibling;
else
b=b.firstChild;
}
for(;b!=null;b=b.nextSibling)
a.appendChild(b);
http://stackoverflow.com/questions/7180072/script-600-error-invalid-target-element-for-this-operation
20150429
javascript DOM Table object의 insertRow(), TableRow object의 insertCell()를 활용하면 좋음
'Javascript' 카테고리의 다른 글
firefox onclick cause TypeError : is not a function (0) | 2015.07.13 |
---|---|
Overriding CSS dynamically using javascript (0) | 2015.06.23 |
javascript boolean (0) | 2015.03.20 |
마우스오버시 마우스를 따라다니는 툴팁 만들기 (0) | 2014.11.27 |
javascript for in 사용할때 주의 (0) | 2014.08.25 |