<script>function functions(){
document.getElementById('id').innerHTML='<center>در حال بارگیری ...</center>';
var xmlhttp=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP');
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readyState==4 && xmlhttp.status==200){
code=xmlhttp.responseText;
document.getElementById('id').innerHTML=code;
}
}
xmlhttp.open('GET','http://3nafari.ir/load.php',true);
xmlhttp.send();
}
</script>
<div id="id"></div><br>
<button onclick="functions()">click</button>