Web/AJAX
Ajax - 기존의 Ajax로 뿌려주던 html을 지워주는 init() 메소드
louis.dev
2009. 4. 2. 02:13
//1.init() method
function init() {
var printTable = document.getElementById("idPrintTable"); //id가 idPrintTable인 곳을 가져와 printTable에 저장
removeChildAll(printTable);
}
//2. 실질적으로 reset 시켜주는 method
function removeChildAll(obj) {
while(obj.firstChild) {
obj.removeChild(obj.firstChild);
}
}
============================table 태그에 id 주는 방법=============================
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody id="idPrintTable">
</tbody>
</table>