how to Show Desktop notification by javascript in Browser

In this tutorial i am going to teach you how to show desktop notification in your browser and now a days it very powerful tool to promote any website and helps the website to get the visitor attention on any particular topic. Today i’ll just teach you how to show desktop notification only and in another tutorial which i’ll post very soon to tell about push notification.

So first of all paste the below code in your file and save it with any name having .html extension.

In this code you can easily understand what is going on and one more thing it does not need to include any jquery file and new Notification is a html5 inbuilt class which needs two parameters first one is Title and other is Option and Notification.requestPermission takes the user permission to allow or block the notification once you allow then you may be disable it by visiting browser setting and for further detail you may google about it and you may also get good knowledge by https://serviceworke.rs/

You may also like...