由网友(记得最初的那个你、)分享简介:如何检查是否一个Ajax的功能是忙碌从previous电话吗?我怎么能prevent调用一个Ajax功能,如果它的 readyState的!= 4 还没有从previous电话?How to check if an ajax function is busy from a previous call? How ca...
如何检查是否一个Ajax的功能是忙碌从previous电话吗?我怎么能prevent调用一个Ajax功能,如果它的 readyState的!= 4
还没有从previous电话?
How to check if an ajax function is busy from a previous call? How can i prevent the call to an ajax function if it's readyState != 4
yet from a previous call?
推荐答案
您可以使用布尔和适当的onreadystatechange functoin;
You can use a boolean and an appropriate onreadystatechange functoin;
var inprogress = true;
ajaxRequest = ...
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
inprogress = false;
}
}
相关推荐
最新文章