js实现加载中效果

注意把async改为true即可

$.ajax({
	url: '#',
	type: 'post',
	async: true,
	contentType: "application/json",
	beforeSend: function(){
    	$("

"
).css({ display: "block", width: "100%", height: $(window).height() }).appendTo("body"); $("

"
).html("正在运行,请稍候...").appendTo("body").css({ display: "block", left: ($(document.body).outerWidth(true) - 190) / 2, top: ($(window).height() - 45) / 2 }); }, complete: function(){ $(".datagrid-mask").remove(); $(".datagrid-mask-msg").remove(); }, success: function (data) { alert("执行成功"); } })

你可能感兴趣的:(js,javascript)