全局設置:ajax
1
2
3
4
5
|
$(document).bind(
"ajaxSend"
,
function
() {
$(
"#loading_message"
).show();
}).bind(
"ajaxComplete"
,
function
() {
$(
"#loading_message"
).hide();
});
|
特殊Ajax請求若是不想呈現Loading,只需增長:global:false便可ide
1
2
3
4
5
|
$.ajax({
type:
"Get"
,
url: ***********,
global:
false
});
|
說明下: 若是使用 jQuery.ajaxSetup() 去綁定請求先後事件,針對特殊請求使用global:false 則無效url