Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<button onclick="notifyMe()">
  Notify me!
</button>
 
function notifyMe() {
  if (!Notification) {
    alert('Notifications are supported in modern versions of Chrome, Firefox, Opera and Firefox.'); 
    return;
  }
  if (Notification.permission !== "granted")
    Notification.requestPermission();
  var notification = new Notification('Notification title', {
    icon: 'http://cdn.sstatic.net/stackexchange/img/logos/so/so-icon.png',
    body: "Hey there! You've been notified!",
  });
  notification.onclick = function () {
    window.open("http://stackoverflow.com/a/13328397/1269037");      
  };
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
dandvpro
0viewers