"notification for browser"
Bootstrap 3.3.0 Snippet by lelelaileabc

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <button type="button" class="btn btn-primary" onclick="show()">Notify me!</button> </div> </div>
function show(){ var title = "new version" , options = { body: "user can download files from site!", icon: "http://bootsnipp.com/img/avatars/80371038613994cd96537912756058cb63fd6adb.jpg" }; if (!("Notification" in window)) { alert("This browser does not support desktop notification"); } else if (Notification.permission === "granted") { var n = new Notification(title, options); n.onshow=function(){ setTimeout(n.close.bind(n), 2000); } n.onclick = function () { n.close(); }; } else if (Notification.permission !== 'denied') { Notification.requestPermission(function (permission) { if (permission === "granted") { var n = new Notification(title, options); } }); } }

Related: See More


Questions / Comments: