$(function () {
$(‘.ajaxForm‘).ajaxForm({
beforeSubmit:showPleaseWait,//提交之前
success: complete2, // 这是提交后的方法
error:ajaxError,// 提交失败,
complete:hidePleaseWait,//提交完成之后
dataType: ‘json‘
});
});
function showPleaseWait() {
var modalLoading = ‘<div class="modal" id="pleaseWaitDialog" data-backdrop="static" data-keyboard="false role="dialog">\
<div class="modal-dialog">\
<div class="modal-content">\
<div class="modal-header">\
<h4 class="modal-title">服务器正在处理,请稍候...</h4>\
</div>\
<div class="modal-body">\
<div class="progress">\
<div class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar"\
aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:100%; height: 40px">\
</div>\
</div>\
</div>\
</div>\
</div>\
</div>‘;
$(document.body).append(modalLoading);
$("#pleaseWaitDialog").modal("show");
}
function hidePleaseWait() {
$("#pleaseWaitDialog").modal("hide");
}