bre*_*rer 1 html5 notifications webkit google-chrome-extension
我正在使用createHTMLNotificationChrome扩展程序.通知的html中包含一个链接.我想弄清楚的是如何在点击链接时关闭通知.我的代码如下
var notification = window.webkitNotifications.createHTMLNotification(
"notification.html"
);
notification.show();
Run Code Online (Sandbox Code Playgroud)
notification.html页面上的代码填写了数据.该页面包含jquery库.当我尝试做的时候:
$('#title > a').click(function() {
notification.cancel();
}
Run Code Online (Sandbox Code Playgroud)
这当然不起作用,因为在这个html页面上通知是未知的.我还尝试notification.onshow在代码的第一部分中创建通知,但是这也没有产生任何结果.