<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 15:45:10 发布
本文详细介绍了如何使用XMLHttpRequest进行异步加载,并通过状态监听实现数据的实时更新。
824

被折叠的 条评论
为什么被折叠?



