function showMsg(title, body, callback){
if(! ('Notification' in window) ){
alert('Sorry bro, your browser is not good enough to display notification');
return;
}
Notification.requestPermission(function(permission){
var options = {body:body,icon:"http://shop.ddt123.cn/favicon.ico"};
var notification = new Notification(title,options);
notification.onclick = function(){window.open(callback);}
});
}
showMsg("温馨提示:","您有一个新的订单,点击查看","http://www.baidu.com");
转载于:https://my.oschina.net/zhuyaxiong/blog/664374