Desktop reminders about HTML5--notification

Source: Internet
Author: User

Describe the test environment as follows:
Ie:11 version
FIREFOX:34 version
chrome:39 version

Statement : Baidu's online search for most of the information, almost all is wrong! Almost all the same is to detect whether the browser supports "desktop reminders" need to use the following code:

Determine if the browser supports notifications
function supported () {
if (window.webkitnotifications) {
Alert (' Browser support notifications ');
} else {
Alert (' Browser does not support notifications ');
}
}

If you put the core object "window.webkitnotifications" in the above code into IE11, Google, and Firefox, the results are all the same--undefined! The three major browser tests are as follows:

Really hate yourself not to see the official HTML5 document. Then finally found an article, the original HTML5 desktop reminders, in fact, in the major browsers have been supported! The object to be detected is not just the webkitnotifications, but one calledwindow. Notification"the Object!

Test findings:
IE11 does not support desktop reminders, the results are as follows:

Firefox and Chrome support, the results are as follows:

So the related functions and code of desktop reminders should be modified as follows:

------------------
Http://www.html5china.com/HTML5features/Notifications/20110926_2049.html

Http://www.html5china.com/HTML5features/Notifications/20110926_2049.html

http://www.html5china.com/HTML5features/Notifications/

Http://www.th7.cn/web/js/201408/53473.shtml

Desktop reminders about HTML5--notification

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.