1 回答
TA贡献1772条经验 获得超6个赞
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div id="info"></div>
<script src="jquery-2.1.4.min.js"></script>
<script>
ajaxSend_global('shehe',4000,'heeh');
function ajaxSend_global(event, xhr, settings) {
$ ("#info").append ("<div><b>i am ajaxSend_global @ global ...</b><div>");
$ ("#info").append ("<div id='time'></div>");
$ ("#info").append ("</br>");
var i=0,intervalId;
if(xhr.status!=200){
intervalId = setInterval(function () {
$("#time").text('结果搜索中...' + (++i));
},1000);
}else {
clearInterval(intervalId);
}
}
</script>
</body>
</html>
添加回答
举报