Ajax

English [?e?e?d??ks] US [?e?d??ks]

n. ?? ??? "Asynchronous JavaScript and XML"(??? JavaScript ? XML)???. ; Ajax ??-??-? ??? ??, Yajis ???

?? [k?m?plit]

adj ??; , ?? ?? ??(??)

??? ajaxComplete() ??? ???

??: ajaxComplete() ???? AJAX ??? ???? ??? ?????. ??? ??????. ajaxSuccess()? ?? ajaxComplete() ???? ?? ??? ??? ??? ???? ?? ???? ??? ???? ?????.

??: ??.jQueryajaxComplete(function(event,xhr,options))

????:

ParametersDescription
function(event,xhr ,??) ?????. ??? ???? ??? ??? ?????. ?? ????: event - ??? ??? ?????. xhr - XMLHttpRequest ??? ?????. options - AJAX ??? ???? ??? ?????.

??: XMLHttpRequest ?? ? ??? ?? ??? ?? ??? ?????.

??? ajaxComplete() ??? ?

<html>
<head>
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
  $("#txt").ajaxStart(function(){
    $("#wait").css("display","block");
  });
  $("#txt").ajaxComplete(function(){
    $("#wait").css("display","none");
  });
  $("button").click(function(){
    alert("加載完成");
    $("h2").text("文本加載完成");
  });
});
</script>
</head>

<body>

<div id="txt"><h2>通過 AJAX 改變文本</h2></div>
<button>改變內(nèi)容</button>
<div id="wait" style="display:none;width:69px;height:89px;border:1px solid black;position:absolute;top:50%;left:50%;padding:2px;">
<img src='http://img.php.cn/upload/article/000/005/656/5af270fd37755429.jpg' width="64" height="64" />
<br />加載中 ...
</div>

</body>
</html>
???? ?? ?

??? ????? ??? "???? ??" ??? ?????