You can now send simple or HTML notifications to the users of your website from JavaScript.
Here’s what the simple notification looks like with an icon included:
Here's the syntax, note you have to check the user has granted permission:
The image below shows a user receiving both a simple plain text (without an icon) and an HTML notification “pop up”:
HTML Code
JavaScript Code
You can run the sample here: http://stevenhollidge.com/html5demos/notifications
Or view all the HTML5Rocks demos here: http://playground.html5rocks.com
No comments:
Post a Comment