Possible Duplicate:
JavaScript - what are alternatives to document.write?
i am creating a javascript function which i want to execute after few seconds but when it executes it removes all the page content and display only that result which i am displaying using document.write() here is my javascript code.
<script language="javascript">
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
setTimeout(function(){
xmlhttp.open("GET","some.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
var x=xmlDoc.getElementsByTagName("offer");
var page = parseInt(x.length) / 10;
document.write("<div class='pagination_btn_cont'>");
for (i=1;i<=page;i++)
{
document.write("<div class='pagination_btn'>"+i+"</div>");
}
document.write("</div>");
},10000);
</script>
when i open the webpage its display all the content of the page but after 10 seconds the page will become blank and display only the numbers which i am getting from the loop.
any suggestion how can do this task.