//导出
$("#export").click(function () {
$(".expIcon").addClass("expIcon_select");
$(".expIcon+span").css({ "color": "#5789DF" });
if (type != 1) {
alert("请先保存或取消后再导出!");
$(".expIcon").removeClass("expIcon_select");
$(".expIcon+span").css({ "color": "#555" });
return;
}
var StartTime = $("#StartTime").val();
$.ajax({
url: '/Report/ExportReport',
data: { "StartTime": StartTime, "ReportType": 15, "HolidayId": 8 },
dataType: "json",
type: "Post",
beforeSend: function () {
isShowload(1);
},
complete: function () {
isShowload(0);
},
success: function (data) {
//获取到的文件名先进行转码再使用,否则可能乱码
var path = escape(data.path);
window.location = "/DownFile/Downfile?name=" + path + "&reporttype=15";
}
});
});
在 complete回调中移除
complete事件是不管成功与否都执行,success只有正确返回(200状态并且是标准json格式字符串才会执行,所以不敢保证正执行到success
complete: function () {
$(".expIcon").removeClass("expIcon_select");////////////////
isShowload(0);
}
$(".expIcon").removeClass("expIcon_select");
$(".expIcon+span").css({ "color": "#555" });
这个不是就是请除样式的代码吗?