JavaScript notifications onclick event

javascript, notifications, webkit

Solution

Try this:

var message = new Notification("RandomString");
message.onclick = function(){alert("Random Message")};

Problem

as soon as Notification instantiates onclick function fires but I want prevent this event before actual click occures on notification ``` var message = new Notification("RandomString"); message.onclick(alert("Random Message")) ```

Original source