javascript - Desktop Notification in asp.net -
i'm using below javascript desktop notification in asp.net. on button click event working fine permission getting error while implementing code behind.
and code added on webpage...
<script type="text/javascript"> function notifyme() { if (!("notification" in window)) { alert("this browser not support desktop notification"); } else if (notification.permission === "granted") { var options = { body: "this body of notification", icon: "stupidcodes.com.png", dir: "ltr" }; var notification = new notification("hi there", options); notification.onclick = function () { window.open("http://www.stupidcodes.com/"); }; } else if (notification.permission !== 'denied') { notification.requestpermission(function (permission) { if (!('permission' in notification)) { notification.permission = permission; } if (permission === 'granted') { var options = { body: 'this body of notification', icon: 'stupidcodes.com.png', dir: 'ltr' }; var notification = new notification('hi there', options); notification.onclick = function () { window.open('http://www.stupidcodes.com/'); }; } }); } }
is there method add notification in asp.net
you can check code working here
please check out my blog post. have created sample fire notification when document loaded. can leverage code per requirements.
Comments
Post a Comment