html5 notification桌面提醒功能
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> 5秒后会弹出一个窗口 <script type="text/javascript"> function notify(){ if(window.webkitNotifications.checkPermission()==0){ var pop=window.webkitNotifications.createNotification("../img/logo.png","友情提示:","开饭了!"); //pop.show(); setTimeout(function () { pop.show(); },5000); }else{ window.webkitNotifications.requestPermission(); } } window.onload=notify(); </script> </body> </html>
原文:http://www.cnblogs.com/gyz418/p/5295659.html