November 2011
Intermediate to advanced
384 pages
13h 23m
English
If the basic notification window structure is too plain for you, you can customize it by launching an HTML notification window with a custom URL. Simply save your notification message into a separate web page, and it will be displayed as the notification window content.
You use the same check permissions and display procedures to create your custom desktop notification UI as described earlier in this chapter, except that you replace createNotification() with createHTMLNotification() and specify the URL as the only argument:
var notifyAPI = window.webkitNotifications; if ( typeof notifyAPI == 'object' && notifyAPI.checkPermission() == 0 ) { var notifyMessage = notifyAPI. createHTMLNotification(URL); notifyMessage ...
Read now
Unlock full access