我有:
..............
$(document)
.ajaxSend(function () {
alert('test'); //for testing in FF
switch (flag_mask) {
case 0:
mask_find_way.hide();
mask_create_way.hide();
mask_load.show();
break;
case 1:
mask_load.hide();
mask_create_way.hide();
mask_find_way.show();
break;
case 2:
mask_find_way.hide();
mask_load.hide();
mask_create_way.show();
break;
}
}).ajaxStop(function () {
mask_load.hide();
mask_find_way.hide();
mask_create_way.hide();
});
..............
我尝试使用jquery 1.8.3,1.11.1,2.1.1和$ .ajaxSend()只能在FF中工作(警报不能正常工作)?
答案 0 :(得分:0)
工作很好:
function preload_mask() {
$(document)
.ajaxSend(function () {
switch (flag_mask) {
case 0:
mask_find_way.hide();
mask_create_way.hide();
mask_load.show();
break;
case 1:
mask_load.hide();
mask_create_way.hide();
mask_find_way.show();
break;
case 2:
mask_find_way.hide();
mask_load.hide();
mask_create_way.show();
break;
}
}).ajaxStop(function () {
mask_load.hide();
mask_find_way.hide();
mask_create_way.hide();
});
}
$(window).load(function() {
preload_mask();
});