html5新版桌面通知
来源:互联网 发布:网站源码小偷破解版 编辑:程序博客网 时间:2024/05/10 08:22
旧的window.webkitNotifications 在chrome上没用了.找不到新的相关文章
window.Notification
Notification(title, options)//@param {String} title 要显示的通知标题//@param {Object} options 备选项参数,键值对//option 结构如下dictionary NotificationOptions { NotificationDirection dir = "auto"; DOMString lang = ""; DOMString body; DOMString tag; DOMString icon;//在实例化的时候会异步的去获取};
//新建一个Notification实例,并根据permission为'granted'来完成notification的显示
var
notification =
new
Notification(
'Hello Notification'
,{body:
"I'm an enginneer!"
});
Notification.permission:
'default' 等同于拒绝 'denied' 意味着用户不想要通知 'granted' 意味着用户同意启用通知
document.getElementById('test123466').onclick = function () { if (window.Notification){ if(Notification.permission==='granted'){ var notification = new Notification('Hello Notification',{body:"I hope that all the browser will support this function!"}); setTimeout(function(){notification.close();},3000); }else { Notification.requestPermission(); }; }else alert('你的浏览器不支持此特性,请下载谷歌浏览器试用该功能');};
0 0
- html5新版桌面通知
- HTML5 Notifications桌面通知
- HTML5的桌面通知
- HTML5 桌面通知
- [html5] (Notification) 桌面通知
- HTML5桌面通知
- html5桌面通知
- html5桌面通知
- HTML5 桌面通知
- HTML5桌面通知:notification
- html5桌面通知 提示
- HTML5桌面通知:notification api
- HTML5桌面通知:notification api
- html5 web notification 桌面通知
- HTML5 桌面通知:Notification API
- HTML5 桌面通知:Notification API
- Html5 系列之:桌面通知Notification
- HTML5的桌面通知Notification api
- PHP代码优化的53个细节
- JS和app交互
- B. After Training
- C# winform DataGridt将行中标记字段转换为要展示的字段名称 比如0,1转换为是或否
- 源码安装rsyslog
- html5新版桌面通知
- ListView的精确定位 和 自下而上展示的ListView
- The Most Popular Java API Classes 地址
- Linux 内核定时器
- Python - Requests 模拟 DWR框架的请求
- pom.xm配置解析
- 基于Hadoop生态圈的数据仓库实践 —— 进阶技术(十一)
- HTTP错误码详解
- html5之Canvas绘制刮刮卡