Squall
Squall

Reputation: 71

html5 showNotification

I have created a desktop notification with window.webkitNotifications.createNotification(). I've seen that gmail use an onclick event on the notification for the redirection, how is it made?

Upvotes: 3

Views: 1085

Answers (1)

Squall
Squall

Reputation: 71

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();

Upvotes: 4

Related Questions