我目前正在使用 Blockui 来阻止页面并在执行 ajax 功能时显示加载 gif。看这里:
$(document).ready(function() {
//shows loading screen whilst posting via ajax
$().ajaxStart(function() {
$.blockUI({ message: '<h1><img src="../images/layout/busy.gif" /> Just a moment...</h1>' }); });
$().ajaxStop($.unblockUI);
//Load table from table.php
//Timestamp resolves IE caching issue
var tsTimeStamp= new Date().getTime();
$.get('table.php',
{action: "get", time: tsTimeStamp},
function(data){
$('#customertable').html(data).slideDown('slow');
});
return true;
});
我的问题是每次执行 ajax 函数时都会阻塞页面。仅在执行某些功能时如何使其显示