setInterval(function () {//每10分钟弹窗预警处理提示
$.ajax({
type:"post",
url:"请求后台url",
async:false,
success:function(data){
if(data.rows.length>0)//判断后台传递List有数据
{
layer.closeAll();//关闭所有layer层,防止重复弹窗
layer.open({
type: 2,
area: ["900px", "600px"],
fix: false,
maxmin: true,
shade: 0.3,
title: "弹出页标题",
content:"弹出页url",
btn: ['确定', '关闭'],
shadeClose: false,
cancel: function(index) {
return true;
}
});
}
},
error: function(){
layer.alert("预警值查询错误!");
}
}
)
},600000) //600秒 (10分钟
暂时没找到标准答案。打开新弹窗前,关闭所有弹窗