学习了ajax技术后给http://proxy.flyy.info添加了新的web2.0的ajax用户体验!!并学习了gmail的异步通讯时候等待的提示
<script type="text/javascript">
//author:amao www.flyy.info
var xmlHttp;
var loading=document.getElementById('loading');
function createXMLHttpRequest(){
if(window.ActiveXObject){
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest){
xmlHttp=new XMLHttpRequest();
}
}
function startRequest(){
createXMLHttpRequest();
xmlHttp.onreadystatechange=handleStateChange;
loading.style.visibility='visible';
xmlHttp.open("GET","proxy_ip_list.php",true);
xmlHttp.send(null);
}
function handleStateChange(){
if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
var div=document.getElementById('proxy_ip_list');
loading.style.visibility='hidden';
div.innerHTML=xmlHttp.responseText;
}
}
}
</script>
<div style="position:absolute;top:0;left:90%;background:red;width:10%;height:14px;visibility:hidden;" id="loading">loading</div>