解析ajax事件的調用順序
更新時間:2013年06月17日 10:41:37 作者:
本篇文章是對ajax事件的調用順序進行了詳細的分析介紹,需要的朋友參考下
jquery的ajax請求方法:
$.ajax({
type: "GET",
dateType:"html",
url: "index.html",
error: function(msg) { alert("error"); },
complete: function(msg) { alert("complete"); },
success: function(msg) { alert("success"); }
});
jquery中各個事件執(zhí)行順序如下:
1.ajaxStart(全局事件)
2.beforeSend
3.ajaxSend(全局事件)
4.success
5.ajaxSuccess(全局事件)
6.error
7.ajaxError (全局事件)
8.complete
9.ajaxComplete(全局事件)
10.ajaxStop(全局事件)
復制代碼 代碼如下:
$.ajax({
type: "GET",
dateType:"html",
url: "index.html",
error: function(msg) { alert("error"); },
complete: function(msg) { alert("complete"); },
success: function(msg) { alert("success"); }
});
jquery中各個事件執(zhí)行順序如下:
1.ajaxStart(全局事件)
2.beforeSend
3.ajaxSend(全局事件)
4.success
5.ajaxSuccess(全局事件)
6.error
7.ajaxError (全局事件)
8.complete
9.ajaxComplete(全局事件)
10.ajaxStop(全局事件)
相關文章
從PHP $_SERVER相關參數判斷是否支持Rewrite模塊
這篇文章主要介紹了如何通過判斷PHP $_SERVER相關參數來驗證頁面是否重定向,但這只是在Apache環(huán)境下才有效,下面來具體的看下2013-09-09

