1.引入layer.js 文件
2.请求时layer 遮罩层
View Code
2.请求时layer 遮罩层
var index = null; $.ajax({ url: "", data: { Id}, dataType: "json", async: false, type: "post", async: false, beforeSend: function () { index = layer.load(2); }, success: function (data) { layer.close(index); if (data.Result) { layer.alert("相关附件已发送至邮箱中,请查收", { icon: 6 }); } else { layer.alert("发送附件失败", { icon: 2 }); } }, error: function (jqXHR, textStatus, errorThrown) { layer.close(index); layer.alert("请求异常!", { icon: 5 }); } });