<script>
function createxhr(){
if(window.ActiveXResponse){ //IE
xmlHttp = new ActiveXResponse();
}elseif(window.XMLHttpResponse){ //非IE
xmlHttp = new XMLHttpResponse
}
}
function loading(){
var img = "<img src="../images/loading.gif">"
if(xmlHttp.readystate == 4){ //请求完成
if(xmlHtt.status == 200){ //请求成功
document.getElementById("data").innerHTML = xmlHttp.responseText;
}
}else{
document.getElementById("data").innerHTML = img;
}
}
</script>
Ajax实现loading效果
最新推荐文章于 2021-08-05 16:54:16 发布