html5 showNotification
I have created a desktop notification with window.webkitNotifications.cre开发者_StackOverflowateNotification()
.
I've seen that gmail use an onclick event on the notification for the redirection, how is it made?
i have found the solution:
var notification = window.webkitNotifications.createNotification(url,title,teaser);
notification.onclick = function(x) { window.focus(); this.cancel(); $(location).attr('href',path);};
notification.show();
精彩评论