全局设置: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