This is the nth question about JS variable scope but I read through the rest and didn't quite get an answer.
var notification = window.webkitNotifications.createNotification(
'image.png', // The image.
'New Post: ',// The title.
'New stuff'// The body.
);
var itemLink = 'http://pathtothefile.com';
notification.onclick = function(itemLink) {
window.focus();
window.open(itemLink,'_blank' );
this.cancel();
};
notification.show();
How do i get itemLink, which is defined in the global scope, to work in the onclick function?