In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly shows you "how to use Notifications desktop reminders in HTML5". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn how to use Notifications desktop reminders in HTML5.
Undefinedundefinedundefined
Example
HTML5-Notifications// determines whether the browser supports Notificationsfunction supported () {if (window.webkitNotifications) {alert ('browser supports Notifications');} else {alert (' browser does not support Notifications');}} / / request desktop notification permission function requestPermission () {window.webkitNotifications.requestPermission () } / / get request permission status function checkPermission () {switch (window.webkitNotifications.checkPermission ()) {case 0:alert ('user has been allowed to display desktop notifications'); break; case 1:alert ('user has not allowed or refused to display desktop notifications'); break; case 2:alert ('user has refused to display desktop notifications'); break }} / / create a text message function textMsg () {var icon = 'logo.png'; var title =' Ah Peng\'s BLOG'; var body = 'http://www.1990c.com'; var popup = window.webkitNotifications.createNotification (icon, title, body) Popup.ondisplay = function (event) {setTimeout (function () {event.currentTarget.cancel ();}, 5000);} popup.show ();} / / create HTML message function htmlMsg () {var popup = window.webkitNotifications.createHTMLNotification ('msg.html') Popup.ondisplay = function (event) {setTimeout (function () {event.currentTarget.cancel ();}, 5000);} popup.show ();}
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.