Saturday, 15 October 2011

HTML5 Notifications

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”:



JavaScript Code

You can run the sample here:

Or view all the HTML5Rocks demos here:

No comments:

Post a Comment