Notifications is a new feature of HTML5~ You can take a look at 360 computer to grab tickets, which is also prompted by Notifications~, below I wrote an HTML5 Notifications desktop reminder, which is pretty good!
<html> <head> <meta charset="utf-8"> <title>HTML5 - Notifications</title> <script> //判断浏览器是否支持Notifications function supported(){ if(window.webkitNotifications){ alert('浏览器支持Notifications'); } else { alert('浏览器不支持Notifications'); } } //请求桌面通知权限 function requestPermission() { window.webkitNotifications.requestPermission(); } //获取请求权限状态 function checkPermission() { switch (window.webkitNotifications.checkPermission()) { case 0:alert('用户已允许显示桌面通知');break; case 1:alert('用户还没有允许或拒绝显示桌面通知');break; case 2:alert('用户已拒绝显示桌面通知');break; } } //创建文本消息 function textMsg(){ var icon = 'logo.png'; var title = '阿鹏\'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(); } //创建HTML消息 function htmlMsg(){ var popup = window.webkitNotifications.createHTMLNotification('msg.html'); popup.ondisplay = function(event) { setTimeout(function() { event.currentTarget.cancel(); }, 5000); } popup.show(); } </script> </head> <body> <input type="button" value="是否支持桌面提醒" onclick="supported();"/> <input type="button" value="请求权限" onclick="requestPermission();"/> <input type="button" value="请求权限状态" onclick="checkPermission();"/> <input type="button" value="显示文本消息" onclick="textMsg();"/> <input type="button" value="显示HTML消息" onclick="htmlMsg();"/> </body> </html>
The above is the detailed content of What are Notifications? HTML5 Notifications Desktop Reminders. For more information, please follow other related articles on the PHP Chinese website!

The core features of HTML5 include semantic tags, multimedia support, form enhancement, offline storage and local storage. 1. Semantic tags such as, improve code readability and SEO effect. 2. Multimedia support simplifies the process of embedding media content through and tags. 3. Form Enhancement introduces new input types and verification properties, simplifying form development. 4. Offline storage and local storage improve web page performance and user experience through ApplicationCache and localStorage.

HTML5isamajorrevisionoftheHTMLstandardthatrevolutionizeswebdevelopmentbyintroducingnewsemanticelementsandcapabilities.1)ItenhancescodereadabilityandSEOwithelementslike,,,and.2)HTML5enablesricher,interactiveexperienceswithoutplugins,allowingdirectembe

Advanced tips for H5 include: 1. Use complex graphics to draw, 2. Use WebWorkers to improve performance, 3. Enhance user experience through WebStorage, 4. Implement responsive design, 5. Use WebRTC to achieve real-time communication, 6. Perform performance optimization and best practices. These tips help developers build more dynamic, interactive and efficient web applications.

H5 (HTML5) will improve web content and design through new elements and APIs. 1) H5 enhances semantic tagging and multimedia support. 2) It introduces Canvas and SVG, enriching web design. 3) H5 works by extending HTML functionality through new tags and APIs. 4) Basic usage includes creating graphics using it, and advanced usage involves WebStorageAPI. 5) Developers need to pay attention to browser compatibility and performance optimization.

H5 brings a number of new functions and capabilities, greatly improving the interactivity and development efficiency of web pages. 1. Semantic tags such as enhance SEO. 2. Multimedia support simplifies audio and video playback through and tags. 3. Canvas drawing provides dynamic graphics drawing tools. 4. Local storage simplifies data storage through localStorage and sessionStorage. 5. The geolocation API facilitates the development of location-based services.

HTML5 brings five key improvements: 1. Semantic tags improve code clarity and SEO effects; 2. Multimedia support simplifies video and audio embedding; 3. Form enhancement simplifies verification; 4. Offline and local storage improves user experience; 5. Canvas and graphics functions enhance the visualization of web pages.

The core features of HTML5 include semantic tags, multimedia support, offline storage and local storage, and form enhancement. 1. Semantic tags such as, etc. to improve code readability and SEO effect. 2. Simplify multimedia embedding with labels. 3. Offline storage and local storage such as ApplicationCache and LocalStorage support network-free operation and data storage. 4. Form enhancement introduces new input types and verification properties to simplify processing and verification.

H5 provides a variety of new features and functions, greatly enhancing the capabilities of front-end development. 1. Multimedia support: embed media through and elements, no plug-ins are required. 2. Canvas: Use elements to dynamically render 2D graphics and animations. 3. Local storage: implement persistent data storage through localStorage and sessionStorage to improve user experience.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

Dreamweaver CS6
Visual web development tools

Dreamweaver Mac version
Visual web development tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft
