后台新订单提醒
// 新订单提醒 function hello() { $.ajax({ url:'checkOrderNum', type:'get', success:function (result) { console.log(result); if (result == 1){ // 右下角弹框 layer.open({ type:0, title: '提示', content: '您有新的订单,请及时查看', anim: 2, shade:0, offset:"rb" }); } } }); $.ajax({ url:'checkSpeedOrderNum', type:'get', success:function (result) { console.log(result); if (result == 1){ // 右下角弹框 layer.open({ type:0, title: '提示', content: '您有新的快速测试订单,请及时查看', anim: 2, shade:0, offset:"rb" }); } } }); } setInterval("hello()",10000);
http://www.runoob.com/jsref/met-win-setinterval.html
使用setInterval()方法