{"id":5474,"date":"2016-07-06T00:43:48","date_gmt":"2016-07-05T16:43:48","guid":{"rendered":"http:\/\/www.zhangxinxu.com\/wordpress\/?p=5474"},"modified":"2018-08-04T20:55:29","modified_gmt":"2018-08-04T12:55:29","slug":"know-html5-web-notification","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2016\/07\/know-html5-web-notification\/","title":{"rendered":"\u7b80\u5355\u4e86\u89e3HTML5\u4e2d\u7684Web Notification\u684c\u9762\u901a\u77e5"},"content":{"rendered":"<p>by <a href=\"http:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=5474\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=5474<\/a><br \/>\n\u672c\u6587\u5168\u6587\u8f6c\u8f7d\u9700\u8d2d\u4e70\u7248\u6743(750\u00a5)\uff0c\u6458\u8981\u5f15\u6d41\u5219\u514d\u8d39\uff0c\u5177\u4f53<a href=\"http:\/\/www.zhangxinxu.com\/sp\/copyright.html\" target=\"_blank\">\u53c2\u89c1\u8fd9\u91cc<\/a><\/p>\n<h3>\u4e00\u3001\u4f20\u7edf\u7684\u901a\u77e5\u5b9e\u73b0<\/h3>\n<p>\u901a\u77e5\u53ef\u4ee5\u8bf4\u662fweb\u4e2d\u6bd4\u8f83\u5e38\u89c1\u4e14\u91cd\u8981\u7684\u529f\u80fd\uff0c\u79c1\u4fe1\u3001\u5728\u7ebf\u63d0\u95ee\u3001\u6216\u8005\u4e00\u4e9b\u5728\u7ebf\u5373\u65f6\u901a\u8baf\u5de5\u5177\u6211\u4eec\u603b\u662f\u5e0c\u671b\u7b2c\u4e00\u65f6\u95f4\u77e5\u9053\u5bf9\u65b9\u6709\u4e86\u65b0\u7684\u53cd\u9988\uff0c\u8fd9\u4e2a\u65f6\u5019\uff0c\u5c31\u9700\u8981\u9875\u9762\u7ed9\u4e88\u5373\u4f7f\u7684\u901a\u77e5\u3002<\/p>\n<p>\u5728\u4ee5\u524d\uff0c\u6211\u4eec\u7684\u901a\u77e5\u5b9e\u73b0\u4e3b\u8981\u662f\u901a\u8fc7\u95ea\u70c1\u9875\u9762\u7684\u6807\u9898\u5185\u5bb9\u6765\u5b9e\u73b0\uff0c\u5b9e\u73b0\u539f\u7406\u5176\u5b9e\u5f88\u7b80\u5355\uff0c\u5c31\u662f\u5b9a\u65f6\u5668\u4e0d\u65ad\u4fee\u6539<code>document.title<\/code>\u7684\u503c\u3002<\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>setInterval(function() {\n    var title = document.title;\n    if (isShine == true) {\n        if (\/\u65b0\/.test(title) == false) {\n            document.title = '\u3010\u4f60\u6709\u65b0\u6d88\u606f\u3011';    \n        } else {\n            document.title = '\u3010\u3000\u3000\u3000\u3000\u3000\u3011';\n        }\n    } else {\n        document.title = titleInit;\n    }\n}, 500);<\/pre>\n<\/div>\n<p>\u7ed3\u679c\u6807\u9898\u5c31\u4f1a\u8fd9\u6837\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201607\/new-message.gif\" width=\"250\" height=\"37\" alt=\"\u4f60\u6709\u65b0\u6d88\u606f gif\" class=\"alignnone\" \/><\/p>\n<p>\u773c\u89c1\u4e3a\u5b9e\uff0c\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/study\/201607\/title-shine.html\" target=\"_blank\">\u6807\u9898\u680f\u95ea\u52a8\u63d0\u793aJS\u6f14\u793ademo<\/a><\/p>\n<p>\u7a97\u4f53\u5931\u7126\u7684\u65f6\u5019\uff0c\u6807\u9898\u5c31\u4f1a\u95ea\u3002<\/p>\n<p>\u8fd9\u91cc\u6709\u4e00\u4e2a\u5c0f\u7684\u77e5\u8bc6\u70b9\uff0c\u5c31\u662f\u6d4f\u89c8\u5668\u7a97\u4f53\u83b7\u5f97\u7126\u70b9\u548c\u5931\u53bb\u7126\u70b9\uff0cChrome\u548cFireFox\u6d4f\u89c8\u5668\u662f<code>window<\/code>\u7684<code>onfocus<\/code>, <code>onblur<\/code>\u65b9\u6cd5\uff1b\u800cIE\u6d4f\u89c8\u5668\u5219\u662f<code>document<\/code>\u7684<code>onfocusin<\/code>, <code>onfocusout<\/code>\u65b9\u6cd5\uff0c\u56e0\u6b64\u6709\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>window.onfocus = function() { };\nwindow.onblur = function() { };\n\n<span style=\"color:green;\">\/\/ for IE<\/span>\ndocument.onfocusin = function() { };\ndocument.onfocusout = function() { };<\/pre>\n<\/div>\n<p>\u5982\u679c\u590d\u6742\u573a\u666f\uff0c\u8bf7\u4f7f\u7528<code>addEventListener<\/code>\u548c<code>attchEvent<\/code>\u8fdb\u884c\u4e8b\u4ef6\u7ed1\u5b9a\u3002<\/p>\n<p>\u7136\u800c\uff0c\u8fd9\u79cd\u63d0\u793a\u6709\u4e2a\u81f4\u547d\u7684\u7f3a\u9677\uff0c\u5c31\u662f\u7528\u6237\u7684\u6d4f\u89c8\u5668\u8981\u4e00\u76f4\u662f\u5f20\u5f00\u7684\u3002\u6bd4\u65b9\u8bf4\u7528\u6237\u6d4f\u89c8\u5668\u6700\u5c0f\u5316\uff0c\u6807\u9898\u5c31\u770b\u4e0d\u89c1\uff0c\u81ea\u7136\u5c31\u65e0\u6cd5\u53ca\u65f6get\u5230\u6709\u65b0\u6d88\u606f\u7684\u4fe1\u606f\u3002<\/p>\n<p>\u597d\u4e86\uff0c\u65b0\u6280\u672f\u7684\u51fa\u73b0\u4e0d\u4f1a\u662f\u65e0\u7f18\u65e0\u6545\u7684\uff0c\u603b\u662f\u4e3a\u89e3\u51b3\u67d0\u4e00\u7c7b\u95ee\u9898\u6216\u9700\u6c42\u51fa\u73b0\u7684\u3002Web Notification\u5c31\u53ef\u4ee5\u5f88\u597d\u5730\u89e3\u51b3\u4e0a\u9762\u7684\u75db\u70b9\u3002<\/p>\n<h3>\u4e8c\u3001HTML5 Web Notification\u684c\u9762\u901a\u77e5\u7279\u70b9<\/h3>\n<p>HTML5 Web Notification\u901a\u77e5\u662f\u5c5e\u4e8e\u684c\u9762\u6027\u8d28\u7684\u901a\u77e5\uff0c\u6709\u70b9\u7c7b\u4f3c\u4e8e\u663e\u793a\u5668\u53f3\u4e0b\u89d2\u8e66\u51fa\u7684QQ\u5f39\u6846\uff0c\u6740\u6bd2\u63d0\u793a\u4e4b\u7c7b\u7684\uff0c\u8ddf\u6d4f\u89c8\u5668\u662f\u8131\u79bb\u7684\uff0c\u6d88\u606f\u662f\u7f6e\u9876\u7684\u3002<\/p>\n<p>\u6bd4\u65b9\u8bf4\uff0c\u4f60\u79c1\u4fe1\u5973\u795e\u8bf4\u201c\u540c\u4e8b\u653e\u6211\u9e3d\u5b50\uff0c\u72ec\u7acb\u65e5\u7684\u7968\u591a\u4e86\u4e00\u5f20\uff0c\u6d6a\u8d39\u4e86\u53ef\u60dc\uff0c\u8981\u4e0d\u9001\u4f60\uff1f\u201d\uff0c\u7136\u540e\u6d4f\u89c8\u5668\u723d\u5feb\u5730\u5173\u95ed\u2026\u2026\u2026\u2026\u7684\u8bdd\uff0c\u4f60\u662f\u6536\u4e0d\u5230\u6d88\u606f\u7684\uff08<em>zxx: \u6b64\u5904\u6709\u66f4\u65b0<\/em>\uff09\uff0c\u53ea\u80fd\u6700\u5c0f\u5316\uff0c\u6216\u975e\u5f53\u524d\u7a97\u53e3\uff0c\u7136\u540e\u4f60\u5c31\u53ef\u4ee5\u5b89\u5b89\u5fc3\u5fc3\u5730\u770b\u300a\u4f59\u7f6a\u300b\uff0c\u6ca1\u9519\uff0c\u5c31\u5b89\u5b89\u5fc3\u5fc3\u5730\u770b\u3002\u8ddf\u4f60\u8bb2\uff0c\u53ea\u8981\u5973\u795e\u4e00\u56de\u590d\uff0c\u7acb\u9a6c\uff0c\u684c\u9762\u53f3\u4e0b\u89d2\u5c31\u4f1a\u51fa\u73b0\uff1a\u201c\u5973\u795e\u8bf4\uff1a\u597d\u554a\uff01\u201d\u7684\u901a\u77e5\u63d0\u793a\uff0c\u4f60\u5c31\u53ef\u4ee5\u79d2\u56de\uff01\u5973\u795e\u770b\u5230\u8fd9\u79d2\u56de\u7684\u901f\u5ea6\uff0c\u5fc3\u91cc\u60f3\u7684\u4e00\u5b9a\u662f\uff1a\u201c\u8fd9\u50bb\u5c0f\u5b50\uff0c\u4e00\u5b9a\u662f\u4e00\u76f4\u76ef\u7740\u5c4f\u5e55\u7b49\u6211\u6d88\u606f\u2026\u2026\u201d \u5267\u60c5\u5c31\u5b8c\u5168\u4e0d\u4e00\u6837\u4e86\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201607\/2016-07-05_220814.png\" width=\"404\" height=\"176\" alt=\"\u5973\u795e\u7684\u56de\u590d\u901a\u77e5\" class=\"alignnone\" \/><\/p>\n<p><strong>\u66f4\u65b0\u4e8e2016-07-12<\/strong><br \/>\n\u6d4f\u89c8\u5668\u5173\u95ed\u662f\u5426\u53ef\u4ee5\u63a5\u6536\u5230Web Notification\u901a\u77e5\uff0c\u5982\u679c\u8bf4\u201c\u6536\u4e0d\u5230\u201d\uff0c\u80af\u5b9a\u662f\u4e0d\u51c6\u786e\u7684\uff0c\u56e0\u4e3a\u6211\u81ea\u5df1\u65f6\u4e0d\u65f6\u53ef\u4ee5\u6536\u5230facebook\u7684\u901a\u77e5\u3002\u4f46\u662f\uff0c\u6055\u6211\u611a\u949d\uff0c\u4e00\u76f4\u6ca1\u60f3\u660e\u767d\u539f\u7406\u3002\u96be\u9053Facebook\u548cChrome\u9171\u6709\u5408\u4f5c\uff0c\u5982\u679c\u662f\u8fd9\u6837\u90a3\u5c31\u662f\u7279\u4f8b\uff1b\u5982\u679c\u4e0d\u662f\uff0c\u90a3\u901a\u77e5\u662f\u54ea\u91cc\u53d1\u51fa\u7684\u5462\uff1f<\/p>\n<p>\u6c42\u8fbe\u4eba\u89e3\u60d1\uff01<\/p>\n<p><strong>\u81ea\u5df1\u66f4\u65b0\u4e8e2018-08-04<\/strong><\/p>\n<p>Facebook\u7684\u901a\u77e5\u662f\u5e94\u8be5\u662f\u4f7f\u7528\u7684FCM\uff0c\u4e5f\u5c31\u662fFirebase\u4e91\u4fe1\u606f\u4f20\u9012\uff0c\u662f\u4e00\u79cd\u8de8\u5e73\u53f0\u6d88\u606f\u4f20\u9012\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<p>\u4f7f\u7528Service Worker\u6ce8\u518c\u5bf9\u8c61\uff0c\u8c03\u8fd9\u4e2a\u5bf9\u8c61\u7684pushManager.subscribe\u7684\u65b9\u6cd5\u8ba9\u6d4f\u89c8\u5668\u5f39\u4e00\u4e2a\u6846\uff0c\u8be2\u95ee\u7528\u6237\u662f\u5426\u5141\u8bb8\u63a5\u53d7\u6d88\u606f\u901a\u77e5\u3002<\/p>\n<p>\u5982\u679c\u70b9\u51fb\u5141\u8bb8\u7684\u8bdd\uff0c\u6d4f\u89c8\u5668\u5c31\u4f1a\u5411FCM\u8bf7\u6c42\u751f\u6210\u4e00\u4e2asubscription\uff08\u8ba2\u9605\uff09\u7684\u6807\u5fd7\u4fe1\u606f\uff0c\u7136\u540e\u628a\u8fd9\u4e2asubscription\u53d1\u7ed9\u670d\u52a1\u7aef\u5b58\u8d77\u6765\uff0c\u7528\u6765\u53d1Push\u7ed9\u5f53\u524d\u7528\u6237\u3002\u670d\u52a1\u7aef\u4f7f\u7528\u8fd9\u4e2asubscription\u7684\u4fe1\u606f\u8c03web push\u63d0\u4f9b\u7684API\u5411FCM\u53d1\u9001\u6d88\u606f\uff0cFCM\u518d\u4e0b\u53d1\u7ed9\u5bf9\u5e94\u7684\u6d4f\u89c8\u5668\u3002\u7136\u540e\u6d4f\u89c8\u5668\u4f1a\u89e6\u53d1Service Worker\u7684push\u4e8b\u4ef6\uff0c\u8ba9Service Worker\u8c03showNotification\u663e\u793a\u8fd9\u4e2apush\u7684\u5185\u5bb9\u3002\u64cd\u4f5c\u7cfb\u7edf\u5c31\u4f1a\u663e\u793a\u8fd9\u4e2aPush\u3002<\/p>\n<p>\u7136\u800c\uff0cFirebase\u56fd\u5185\u88ab\u5899\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u65e0\u6cd5\u63a8\u9001\u6d88\u606f\uff0c\u5927\u5927\u5f71\u54cd\u4e86\u6b64\u529f\u80fd\u7684\u6536\u76ca\u3002\u8981\u60f3\u6709\u7528\uff0c\u9700\u8981\u4e00\u4e2a\u5883\u5916\u670d\u52a1\u5668\u4e2d\u8f6c\uff0c\u6216\u7528\u6237\u81ea\u5df1\u68af\u5b50\u5df2\u7ecf\u67b6\u8d77\u6765\u4e86\u3002<\/p>\n<p><strong>\u517c\u5bb9\u6027<\/strong><br \/>\nIE14\u4ee5\u53ca\u5176\u4ed6\u684c\u9762\u6d4f\u89c8\u5668\u90fd\u652f\u6301Web Notification\uff0c\u76ee\u524d\u79fb\u52a8\u7aef\u7684\u652f\u6301\u60c5\u51b5\u5e76\u4e0d\u597d\uff0cAndroid\u90e8\u5206\u652f\u6301\uff0ciOS Safari\u6d4f\u89c8\u5668\u5168\u519b\u8986\u6ca1(\u81f39.3\u7248\u672c)\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201607\/2016-07-05_221531.png\" width=\"1130\" height=\"317\" alt=\"Web Notification\u517c\u5bb9\u6027\u622a\u56fe\" class=\"alignnone\" \/><\/p>\n<p>\u79fb\u52a8\u7aef\u8981\u662f\u652f\u6301\u7684\u8bdd\uff0c\u6211\u731c\uff0c\u53ef\u80fd\u4f1a\u8ddf\u539f\u751fapp\u7684\u63d0\u793a\u6548\u679c\u7c7b\u4f3c\uff0c\u76f4\u63a5\u51fa\u73b0\u5728\u5c4f\u5e55\u4e0a\uff0c\u611f\u89c9\u5230\u65f6\u5019\u5e94\u8be5\u86ee\u540a\uff01<\/p>\n<h3>\u4e09\u3001HTML5 Web Notification\u8bed\u6cd5<\/h3>\n<div class=\"zxx_code\">\n<pre>window.Notification<\/pre>\n<\/div>\n<p>\u5982\u679c\u6d4f\u89c8\u5668\u652f\u6301Web Notification\uff0c\u4e0d\u8003\u8651\u79c1\u6709\u524d\u7f00\uff0c\u5219window.Notification\u5c31\u4f1a\u662f\u4e00\u4e2a\u6709\u5f88\u591a\u9759\u6001\u5c5e\u6027\u548c\u5b9e\u4f8b\u65b9\u6cd5\u7684\u51fd\u6570\u3002\u57fa\u672c\u4e0a\uff0cWeb Notification\u6240\u6709\u7684\u8bed\u6cd5\u90fd\u662f\u56f4\u7ed5Notification\u8fd9\u4e2a\u51fd\u6570\u6765\u8fdb\u884c\u7684\u3002<\/p>\n<p>\u663e\u7136\uff0c\u901a\u77e5\u8fd9\u79cd\u4e8b\u60c5\u662f\u6709\u53ef\u80fd\u6270\u6c11\u7684\uff0c\u56e0\u6b64\uff0c\u5fc5\u987b\u7ecf\u8fc7\u7528\u6237\u540c\u610f\u624d\u884c\u3002\u56e0\u6b64\uff1a<\/p>\n<p><strong>1. Notification.requestPermission()<\/strong><\/p>\n<p>\u8fd9\u662f\u4e00\u4e2a\u9759\u6001\u65b9\u6cd5\uff0c\u4f5c\u7528\u5c31\u662f\u8ba9\u6d4f\u89c8\u5668\u51fa\u73b0\u662f\u5426\u5141\u8bb8\u901a\u77e5\u7684\u63d0\u793a\uff0cwindow\u7cfb\u7edfChrome\u6d4f\u89c8\u5668\u76ee\u524d\u7684UI\u6548\u679c\u662f\u8fd9\u6837\u7684\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201607\/2016-07-05_220512.png\" width=\"427\" height=\"198\" alt=\"\u662f\u5426\u5141\u8bb8\u663e\u793a\u901a\u77e5\" class=\"alignnone\" \/><\/p>\n<p>\u8bed\u6cd5\u76ee\u524d\u6709\u65b0\u65e7\u4e24\u79cd\uff0c\u4e0b\u9762\u8fd9\u4e2a\u662f\u6700\u8fd1\u89c4\u8303\u4e0a\u66f4\u65b0\u7684\u57fa\u4e8epromise\u7684\u8bed\u6cd5\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>Notification.requestPermission().then(function(permission) { ... });<\/pre>\n<\/div>\n<p>\u4e0b\u9762\u8fd9\u4e2a\u662f\u57fa\u4e8e\u7b80\u5355\u7684\u56de\u8c03\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>Notification.requestPermission(callback);<\/pre>\n<\/div>\n<p>\u5176\u4e2d<code>callback<\/code>\u662f\u53ef\u9009\u53c2\u6570\uff0c\u6839\u636e<a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Notification\/requestPermission\" target=\"_blank\">MDN<\/a>\u7684\u8bf4\u6cd5\uff0cGecko 46\u5f00\u59cb\u820d\u5f03\u4e86\u8fd9\u79cd\u8bed\u6cd5\uff0c\u4f46\u662f\uff0c\u6211\u81ea\u5df1\u4f7f\u7528FireFox 47\u6d4b\u8bd5\uff0c\u8dd1\u5f97\u5f88\u6b63\u5e38\uff08\u6709part4\u7684\u622a\u56fe\u4e3a\u8bc1\uff09\u3002\u96be\u9053FireFox\u7684\u7248\u672c\u53f7\u4e0d\u7b49\u540c\u4e8eGecko\u7684\u7248\u672c\u53f7\uff1f<\/p>\n<p>\u65e0\u8bba\u662fthen\u4e2d\u7684\u8fd8\u662f\u76f4\u63a5callback\u51fd\u6570\u7684\u53c2\u6570\u90fd\u662f\u4e00\u6837\u7684\uff0c\u8868\u793a\u5f53\u524d\u662f\u5426\u5141\u8bb8\u3002\u53ea\u4f1a\u662f<code>granted<\/code>, <code>denied<\/code>, \u6216<code>default<\/code>.<\/p>\n<p>\u5176\u4e2d<code>granted<\/code>\u8868\u793a\u7528\u6237\u5141\u8bb8\u901a\u77e5\uff0c<code>denied<\/code>\u8868\u793a\u7528\u6237\u5acc\u5f03\u4f60\uff0c<code>default<\/code>\u8868\u793a\u7528\u6237\u76ee\u524d\u8fd8\u6ca1\u6709\u7ba1\u4f60\u3002<\/p>\n<div class=\"zxx_code\">\n<pre>Notification.requestPermission().then(function(result) {\n  \/\/ result\u53ef\u80fd\u662f\u662fgranted, denied, \u6216default.\n});<\/pre>\n<\/div>\n<p><strong>2. Notification.permission<\/strong><sup>[\u53ea\u8bfb]<\/sup><br \/>\n\u8fd9\u662f\u4e00\u4e2a\u9759\u6001\u5c5e\u6027\u3002\u8868\u793a\u662f\u5426\u5141\u8bb8\u901a\u77e5\uff0c\u503c\u5c31\u662f\u4e0a\u9762\u7684<code>granted<\/code>, <code>denied<\/code>, \u6216<code>default<\/code>. <\/p>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c<code>Notification.permission<\/code>\u7684\u503c\u662f<code>'default'<\/code>:<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201607\/2016-07-05_224126.png\" width=\"220\" height=\"89\" alt=\"\u9ed8\u8ba4\u7528\u6237\u662f\u5426\u5141\u8bb8\u901a\u77e5\u7684\u503c\" class=\"alignnone\" \/><\/p>\n<p>\u56e0\u6b64\uff0c<code>Notification.requestPermission()<\/code>\u7684\u56de\u8c03\u65b9\u6cd5\u4e2d\uff0c\u53ef\u4ee5\u4e0d\u4f7f\u7528<code>result<\/code>\u53c2\u6570\uff0c\u76f4\u63a5\u4f7f\u7528<code>Notification.permission<\/code>\u83b7\u53d6\u5f53\u524d\u7684\u901a\u77e5\u72b6\u6001\u3002<\/p>\n<p>\u73b0\u5728\uff0c\u7528\u6237\u5141\u8bb8\u51fa\u901a\u77e5\u4e86\uff0c\u6211\u4eec\u4e5f\u77e5\u9053\u53ef\u4ee5\u51fa\u901a\u77e5\u4e86\uff0c\u4e0b\u9762\u5269\u4e0b\u7684\u5c31\u662f\u663e\u793a\u901a\u77e5\u4e86\u3002<\/p>\n<p><strong>3. new Notification(title, options)<\/strong><br \/>\n\u901a\u8fc7new\u6784\u9020\uff0c\u663e\u793a\u901a\u77e5\u3002\u5176\u4e2d<code>title<\/code>\u662f\u5fc5\u987b\u53c2\u6570\uff0c\u8868\u793a\u901a\u77e5\u5c0f\u6846\u6846\u7684\u6807\u9898\u5185\u5bb9\uff0c<code>options<\/code>\u662f\u53ef\u9009\u53c2\u6570\uff0c\u5bf9\u8c61\uff0c\u652f\u6301\u7684\u53c2\u6570\u4ee5\u53ca\u91ca\u4e49\u89c1\u4e0b\u8868\uff1a<\/p>\n<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"10\" class=\"params_table\">\n<tbody>\n<tr>\n<th scope=\"col\" style=\"width:6em;\">\u5c5e\u6027\u540d<\/th>\n<th scope=\"col\">\u91ca\u4e49<\/th>\n<\/tr>\n<tr>\n<td>dir<\/td>\n<td>\u9ed8\u8ba4\u503c\u662f<code>auto<\/code>, \u53ef\u4ee5\u662f<code>ltr<\/code>\u6216<code>rtl<\/code>\uff0c\u6709\u70b9\u7c7b\u4f3c<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/2016\/03\/css-direction-introduction-apply\/\">direction\u5c5e\u6027<\/a>\u3002\u8868\u793a\u63d0\u793a\u4e3b\u4f53\u5185\u5bb9\u7684\u6c34\u5e73\u4e66\u5199\u987a\u5e8f\u3002<\/td>\n<\/tr>\n<tr>\n<td>lang<\/td>\n<td>\u63d0\u793a\u7684\u8bed\u8a00\u3002\u6ca1\u770b\u51fa\u6765\u6709\u4ec0\u4e48\u7528\u3002\u5927\u5bb6\u53ef\u4ee5\u5ffd\u7565\u4e4b~<\/td>\n<\/tr>\n<tr>\n<td>body<\/td>\n<td>\u63d0\u793a\u4e3b\u4f53\u5185\u5bb9\u3002\u5b57\u7b26\u4e32\u3002\u4f1a\u5728\u6807\u9898\u7684\u4e0b\u9762\u663e\u793a\u3002\u6bd4\u65b9\u8bf4\u4e0a\u9762\u7684\u201c\u597d\u554a\uff01(\u5bb3\u7f9e.gif)\u201d\u3002<\/td>\n<\/tr>\n<tr>\n<td>tag<\/td>\n<td>\u5b57\u7b26\u4e32\u3002\u6807\u8bb0\u5f53\u524d\u901a\u77e5\u7684\u6807\u7b7e\u3002<\/td>\n<\/tr>\n<tr>\n<td>icon<\/td>\n<td>\u5b57\u7b26\u4e32\u3002\u901a\u77e5\u9762\u677f\u5de6\u4fa7\u90a3\u4e2a\u56fe\u6807\u5730\u5740\u3002<\/td>\n<\/tr>\n<tr>\n<td>data<\/td>\n<td>\u4efb\u610f\u7c7b\u578b\u548c\u901a\u77e5\u76f8\u5173\u8054\u7684\u6570\u636e\u3002<\/td>\n<\/tr>\n<tr>\n<td>vibrate<\/td>\n<td>\u901a\u77e5\u663e\u793a\u65f6\u5019\uff0c\u8bbe\u5907\u9707\u52a8\u786c\u4ef6\u9700\u8981\u7684<a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Vibration_API#Vibration_patterns\" target=\"_blank\">\u632f\u52a8\u6a21\u5f0f<\/a>\u3002\u6240\u8c13\u632f\u52a8\u6a21\u5f0f\uff0c\u6307\u7684\u662f\u4e00\u4e2a\u63cf\u8ff0\u4ea4\u66ff\u65f6\u95f4\u7684\u6570\u7ec4\uff0c\u5206\u522b\u8868\u793a\u632f\u52a8\u548c\u4e0d\u632f\u52a8\u7684\u6beb\u79d2\u6570\uff0c\u4e00\u76f4\u4ea4\u66ff\u4e0b\u53bb\u3002\u4f8b\u5982[200, 100, 200]\u8868\u793a\u8bbe\u5907\u632f\u52a8200\u6beb\u79d2\uff0c\u7136\u540e\u505c\u6b62100\u6beb\u79d2\uff0c\u518d\u632f\u52a8200\u6beb\u79d2\u3002<\/td>\n<\/tr>\n<tr>\n<td>renotify<\/td>\n<td>\u5e03\u5c14\u503c\u3002\u65b0\u901a\u77e5\u51fa\u73b0\u7684\u65f6\u5019\u662f\u5426\u66ff\u6362\u4e4b\u524d\u7684\u3002\u5982\u679c\u8bbe\u4e3a<code>true<\/code>\uff0c\u5219\u8868\u793a\u66ff\u6362\uff0c\u8868\u793a\u5f53\u524d\u6807\u8bb0\u7684\u901a\u77e5\u53ea\u4f1a\u51fa\u73b0\u4e00\u4e2a\u3002\u6ce8\u610f\u90fd\u8fd9\u91cc\u201c\u5f53\u524d\u6807\u8bb0\u201d\u6ca1\uff1f\u6ca1\u9519\uff0c<code>true<\/code>\u53c2\u6570\u8981\u60f3\u5176\u4f5c\u7528\uff0c\u5fc5\u987b<code>tag<\/code>\u9700\u8981\u8bbe\u7f6e\u5c5e\u6027\u503c\u3002\u7136\u540e\uff0c\u901a\u77e5\u5c31\u4f1a\u50cf\u8fd9\u6837\u8986\u76d6\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201607\/message-replace.gif\" width=\"385\" height=\"121\" alt=\"\u5973\u795e\u5f39\u6846\u8986\u76d6gif\" class=\"alignnone\" \/><\/p>\n<p>\u800c\u4e0d\u4f1a\u662f\u9ed8\u8ba4\u7684\u53e0\u9ad8\u697c\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201607\/2016-07-05_233335.png\" width=\"411\" height=\"248\" alt=\"\u53e0\u9ad8\u697c\" class=\"alignnone\" \/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>silent<\/td>\n<td>\u5e03\u5c14\u503c\u3002\u901a\u77e5\u51fa\u73b0\u7684\u65f6\u5019\uff0c\u662f\u5426\u8981\u6709\u58f0\u97f3\u3002\u9ed8\u8ba4<code>false<\/code>, \u8868\u793a\u65e0\u58f0\u3002<\/td>\n<\/tr>\n<tr>\n<td>sound<\/td>\n<td>\u5b57\u7b26\u4e32\u3002\u97f3\u9891\u5730\u5740\u3002\u8868\u793a\u901a\u77e5\u51fa\u73b0\u8981\u64ad\u653e\u7684\u58f0\u97f3\u8d44\u6e90\u3002<\/td>\n<\/tr>\n<tr>\n<td>noscreen<\/td>\n<td>\u5e03\u5c14\u503c\u3002\u662f\u5426\u4e0d\u518d\u5c4f\u5e55\u4e0a\u663e\u793a\u901a\u77e5\u4fe1\u606f\u3002\u9ed8\u8ba4<code>false<\/code>, \u8868\u793a\u8981\u5728\u5c4f\u5e55\u4e0a\u663e\u793a\u901a\u77e5\u5185\u5bb9\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201607\/notice-iphone.jpg\" width=\"250\" height=\"424\" alt=\"\u663e\u793a\u684c\u9762\u901a\u77e5\" class=\"alignnone\" \/><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>sticky<\/td>\n<td>\u5e03\u5c14\u503c\u3002\u662f\u5426\u901a\u77e5\u5177\u6709\u7c98\u6027\uff0c\u8fd9\u6837\u7528\u6237\u4e0d\u592a\u5bb9\u6613\u6e05\u9664\u901a\u77e5\u3002\u9ed8\u8ba4<code>false<\/code>, \u8868\u793a\u6ca1\u6709\u7c98\u6027\u3002\u6839\u636e\u6211\u81ea\u5df1\u7684\u731c\u6d4b\uff0c\u5e94\u8be5\u548c<code>position<\/code>\u7684<code>sticky<\/code>\u5c5e\u6027\u503c\u7c7b\u4f3c\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>4. Notification.close()<\/strong><br \/>\n\u901a\u77e5\u663e\u793a\u4e86\uff0c\u5982\u4f55\u5173\u95ed\u5462\uff1f\u53ef\u4ee5\u901a\u8fc7\u8c03\u7528<code>Notification.close()<\/code>\u5b9e\u4f8b\u65b9\u6cd5\uff0c\u5b9e\u9645\u4e0a\uff0c\u901a\u77e5\u5982\u679c\u4f60\u653e\u7740\u4e0d\u7ba1\uff0c\u4e00\u6bb5\u65f6\u95f4\u540e\u5c31\u4f1a\u81ea\u52a8\u9690\u85cf\uff0c\u5177\u4f53\u591a\u4e45\u4e0d\u8be6\uff0c\u6211\u4f30\u6478\u77405\u79d2\u6709\u7684\u3002<\/p>\n<p><strong>5. \u4e8b\u4ef6\u53e5\u67c4<\/strong><br \/>\n<strong>Notification.onclick<\/strong><br \/>\n\u70b9\u51fb\u901a\u77e5\uff0c\u7136\u540e\u2026\u2026<\/p>\n<p><strong>Notification.onerror<\/strong><br \/>\n\u901a\u77e5\u663e\u793a\u5f02\u5e38\uff0c\u7136\u540e\u3002\u4f8b\u5982\uff0c\u660e\u660e<code>Notification.permission<\/code>\u662f<code>default<\/code>\uff0c\u4f60\u8fd8\u8ba9\u6211\u663e\u793a\u3002<\/p>\n<p>\u4e0b\u9762\u8fd9\u4e9b\u5462\u6709\u5fc5\u8981\u72ec\u7acb\u51fa\u6765\uff0c\u867d\u7136\u73b0\u5728\u662f\u652f\u6301\u633a\u597d\u7684\uff0c\u4f46\u662f\uff0c\u7531\u4e8e\u76ee\u524d\u89c4\u8303\u5e76\u6ca1\u6709\u628a\u5b83\u4eec\u5217\u5165\u5176\u4e2d\uff0c\u6240\u4ee5\uff0c\u672a\u6765\u6709\u53ef\u80fd\u6d4f\u89c8\u5668\u5c31\u4e0d\u652f\u6301\u4e86\u3002<br \/>\n<strong>Notification.onclose<\/strong><br \/>\n\u901a\u77e5\u5173\u95ed\u4e86\uff0c\u7136\u540e\u2026\u2026 \u65e0\u8bba\u662f\u7528\u6237\u624b\u52a8\u5173\u95ed\uff0c\u8fd8\u662f\u76f4\u63a5<code>Notification.close()<\/code>\u5173\u95ed\u90fd\u4f1a\u89e6\u53d1\u8be5\u8be5\u4e8b\u4ef6\u3002<\/p>\n<p><strong>Notification.onshow<\/strong><br \/>\n\u901a\u77e5\u663e\u793a\u7684\u65f6\u5019\uff0c\u8be5\u5e72\u561b\u5e72\u561b~~<\/p>\n<p><strong>6. \u5176\u4ed6\u5c5e\u6027\u503c<\/strong><br \/>\n\u9664\u4e86<code>Notification.permission<\/code>\u5916\uff0c<code>Notification<\/code>\u8fd8\u6709\u5f88\u591a\u5176\u4ed6\u53ea\u8bfb\u5c5e\u6027\u503c\uff0c\u4f46\u662f\uff0c\u57fa\u672c\u4e0a\u548c\u4e0a\u9762\u7684<code>options<\/code>\u53c2\u6570\u4e00\u81f4\uff0c\u8fd4\u56de\u7684\u503c\u4e5f\u662f<code>options<\/code>\u548c\u9ed8\u8ba4\u503c\u7684\u5408\u5e76\u503c\uff08\u5982\u679c\u6d4f\u89c8\u5668\u652f\u6301\u7684\u8bdd\uff09\u3002<\/p>\n<p><strong>Notification.title<\/strong><sup>[\u53ea\u8bfb]<\/sup><\/p>\n<p><strong>Notification.dir<\/strong><sup>[\u53ea\u8bfb]<\/sup><\/p>\n<p><strong>Notification.lang<\/strong><sup>[\u53ea\u8bfb]<\/sup><\/p>\n<p><strong>Notification.body<\/strong><sup>[\u53ea\u8bfb]<\/sup><\/p>\n<p><strong>Notification.tag<\/strong><sup>[\u53ea\u8bfb]<\/sup><\/p>\n<p><strong>Notification.icon<\/strong><sup>[\u53ea\u8bfb]<\/sup><\/p>\n<p><strong>Notification.data<\/strong><sup>[\u53ea\u8bfb]<\/sup><\/p>\n<p><strong>Notification.silent<\/strong><sup>[\u53ea\u8bfb]<\/sup><\/p>\n<p><strong>Notification.title<\/strong><sup>[\u53ea\u8bfb]<\/sup><\/p>\n<p><strong>Notification.timestamp<\/strong><sup>[\u53ea\u8bfb]<\/sup><br \/>\n\u901a\u77e5\u521b\u5efa\u6216\u8005\u53ef\u4ee5\u4f7f\u7528\u7684\u65f6\u95f4\u3002<\/p>\n<p><strong>Notification.noscreen<\/strong><sup>[\u53ea\u8bfb]<\/sup><\/p>\n<p><strong>Notification.renotify<\/strong><sup>[\u53ea\u8bfb]<\/sup><\/p>\n<p><strong>Notification.sound<\/strong><sup>[\u53ea\u8bfb]<\/sup><\/p>\n<p><strong>Notification.sticky<\/strong><sup>[\u53ea\u8bfb]<\/sup><\/p>\n<p><strong>Notification.vibrate<\/strong><sup>[\u53ea\u8bfb]<\/sup><\/p>\n<h3>\u56db\u3001HTML5 Web Notification\u5b9e\u4f8b\u6f14\u793a<\/h3>\n<p>\u77e5\u9053\u4e86\u4f5c\u7528\u548cAPI\uff0c\u4e0b\u9762\u5c31\u53ef\u4ee5\u6765\u4e2a\u5b9e\u4f8b\u6f14\u793a\u4e0b\uff0c\u770b\u770b\u7a76\u7adf\u771f\u9762\u76ee\u5982\u4f55\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/study\/201607\/web-notifications.html\" target=\"_blank\">\u6d4f\u89c8\u5668\u901a\u77e5Web Notifications\u5b9e\u4f8bdemo<\/a><\/p>\n<p>\u70b9\u51fbdemo\u9875\u9762\u6309\u94ae\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201607\/2016-07-06_002004.png\" width=\"188\" height=\"94\" alt=\"demo\u6309\u94ae\u622a\u56fe\" class=\"alignnone\" \/><\/p>\n<p>\u5982\u679c\u4f60\u662f\u7b2c\u4e00\u6b21\uff0c\u4f1a\u6709\u5982\u4e0b\u63d0\u793a\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201607\/2016-07-05_220512.png\" width=\"427\" height=\"198\" alt=\"\u662f\u5426\u5141\u8bb8\u663e\u793a\u901a\u77e5\" class=\"alignnone\" \/><\/p>\n<p>\u901a\u8fc7\u540e\uff0c\u5c31\u4f1a\u51fa\u73b0\u59b9\u5b50\u76f8\u5173\u7684\u901a\u77e5\u4fe1\u606f\u4e86\uff0c\u4f8b\u5982\uff0cFireFox\u6d4f\u89c8\u5668\u4e0b\uff08\u4f7f\u7528\u7684\u662fcallback\u56de\u8c03\u5b9e\u73b0\uff09\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201607\/2016-07-05_223136.png\" width=\"409\" height=\"196\" alt=\"FireFox\u6d4f\u89c8\u5668\u4e0b\u7684\u63d0\u793a\u5185\u5bb9\u622a\u56fe\" class=\"alignnone\" \/><\/p>\n<p>\u6b64\u65f6\uff0c\u4f60\u6d4f\u89c8\u5668\u6700\u5c0f\u5316\uff0c\u6216\u8005\u9875\u9762\u5237\u65b0\uff0c\u8be5\u901a\u77e5\u90fd\u662f\u7eb9\u98ce\u4e0d\u52a8\u7684\u3002\u70b9\u51fb\u901a\u77e5\uff0c\u53ef\u4ee5\u548c\u9875\u9762\u8fdb\u884c\u4ea4\u4e92\uff0c\u4f8b\u5982\uff0c\u672cdemo\u663e\u793a\u4e86\u4e00\u6bb5\u6587\u5b57\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201607\/2016-07-06_002320.png\" width=\"281\" height=\"125\" alt=\"\u5f20\u5c0f\u59d0\u52a0\u597d\u53cb\u622a\u56fe\" class=\"alignnone\" \/><\/p>\n<p>\u6838\u5fc3\u4ee3\u7801\u5982\u4e0b\uff08\u663e\u793a\u548c\u70b9\u51fb\uff09\uff1a<\/p>\n<div class=\"zxx_code\">\n<pre>if (Notification.permission == \"granted\") {\n    var notification = new Notification(\"Hi\uff0c\u5e05\u54e5\uff1a\", {\n        body: '\u53ef\u4ee5\u52a0\u4f60\u4e3a\u597d\u53cb\u5417\uff1f',\n        icon: 'mm1.jpg'\n    });\n    \n    notification.onclick = function() {\n        text.innerHTML = '\u5f20\u5c0f\u59d0\u5df2\u4e8e' + new Date().toTimeString().split(' ')[0] + '\u52a0\u4f60\u4e3a\u597d\u53cb\uff01';\n        notification.close();    \n    };\n}    \n<\/pre>\n<\/div>\n<p>\u5b8c\u6574\u6d4b\u8bd5\u4ee3\u7801\u53c2\u89c1demo\u3002<\/p>\n<p>\u81f3\u6b64\uff0c\u4e00\u4e2a\u53ef\u4ee5\u5e94\u7528\u4e8e\u5b9e\u9645\u5f00\u53d1\u7684Web Notification demo\u5c31\u8dc3\u7136\u7eb8\u4e0a\u4e86\u3002\u597d\u50cffacebook\u5df2\u7ecf\u5728\u4f7f\u7528Web Notification\u4e86\u3002<\/p>\n<p><strong>\u66f4\u65b0\u4e8e2017-07-14<\/strong><br \/>\n\u6700\u65b0\u7684Chrome\u7684Notification\u8981\u60f3\u6709\u6548\u679c\u9700\u8981<code>https<\/code>\u534f\u8bae\u624d\u884c\uff0c\u56e0\u6b64\uff0c\u4e0a\u9762\u7684demo\u53ef\u80fd\u5c31\u6ca1\u6709\u6548\u679c\u3002\u5982\u679c\u8fd9\u6837\uff0c\u53ef\u4ee5<a href=\"https:\/\/zhangxinxu.github.io\/https-demo\/notification\/basic.html\" target=\"_blank\" class=\"a_link\">\u70b9\u51fb\u8fd9\u91cc<\/a>\u611f\u53d7\u6548\u679c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201707\/2017-07-14_231024.png\" width=\"509\" height=\"360\" alt=\"demo\u9875\u9762\u64cd\u4f5c\u793a\u610f\u622a\u56fe\" class=\"alignnone\" \/><\/p>\n<p>\u70b9\u51fb\u6309\u94ae\u540e\u7684\u63d0\u793a\u6548\u679c\u7c7b\u4f3c\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/image.zhangxinxu.com\/image\/blog\/201707\/2017-07-14_231400.png\" width=\"368\" height=\"96\" alt=\"\u63d0\u793a\u6548\u679c\u622a\u56fe\" class=\"alignnone\" \/><\/p>\n<h3>\u4e94\u3001\u7ed3\u675f\u8bed<\/h3>\n<p>\u7ec6\u5fc3\u7684\u5c0f\u4f19\u4f34\u53ef\u80fd\u53d1\u73b0\u6587\u7ae0\u7684\u8f6c\u8f7d\u534f\u8bae\u53d8\u4e86\uff0c\u4ee5\u524d\u90fd\u662f\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\uff0c\u4f46\u662f\uff0c\u73b0\u5728\uff0c\u4e0d\u5141\u8bb8\u968f\u4fbf\u8f6c\u8f7d\u4e86\u3002\u56e0\u4e3a\u6709\u4e9b\u7f51\u7ad9\u7684\u505a\u6cd5\u6211\u5b9e\u5728\u5fcd\u65e0\u53ef\u5fcd\uff0c\u5982\u679c\u8f6c\u8f7d\u4e00\u4e9b\u7ecf\u5178\u7684\u6587\u7ae0\uff0c\u6211\u8fd8\u53ef\u4ee5\u7406\u89e3\uff0c\u4f46\u662f\uff0c\u51e0\u4e4e\u628a\u6574\u7ad9\u90fd\u642c\u8fc7\u53bb\uff0c\u90a3\u5c31\u4e0d\u662f\u77e5\u8bc6\u4f20\u64ad\u4e86\uff0c\u800c\u662f\u52b3\u52a8\u679c\u5b9e\u7684\u7a83\u53d6\uff0c\u4e3a\u5df1\u8c0b\u5229\u7684\u5546\u4e1a\u505a\u6cd5\u4e86\u3002<\/p>\n<p>\u6bd4\u65b9\u8bf4\u672c\u6587\uff0c\u8bbe\u8ba1demo\uff0c\u9a8c\u8bc1API\u7ec6\u8282\uff0c\u622a\u56fe\uff0c\u5236\u4f5cGif\u4ee5\u53ca\u6587\u7ae0\u4e66\u5199\uff0c\u90a3\u53ef\u662f\u8fde\u7eed3\u59291\u70b9\u591a\u7761\u89c9\u71ac\u51fa\u6765\u7684\uff0c\u7d2f\u79ef\u82b1\u8d39\u5341\u51e0\u4e2a\u5c0f\u65f6\u3002\u4f60\u8bf4\uff0c\u88ab\u67d0\u4e9b\u4eba\u5927\u624b\u4e00\u6325\uff0c\u5206\u5206\u949f\u5f04\u8fc7\u53bb\uff0c\u4e0d\u653e\u539f\u6587\u5730\u5740\uff0c\u6216\u8005\u5730\u5740\u505a\u5f97\u50cf\u5f69\u86cb\u4e00\u6837\uff0c\u96be\u4ee5\u8f7b\u6613\u53d1\u73b0\u3002\u90a3\u5bf9\u539f\u4f5c\u8005\u662f\u6ca1\u6709\u4e00\u70b9\u70b9\u7684\u5c0a\u91cd\u554a\uff01<\/p>\n<p>\u6240\u4ee5\uff0c\u4ece\u672c\u7bc7\u6587\u7ae0\u5f00\u59cb\uff0c\u4e5f\u5c31\u662f2016\u5e747\u6708\u5f00\u59cb\uff0c\u4f7f\u7528\u65b0\u7684\u8f6c\u8f7d\u534f\u8bae\uff0c\u4e3b\u8981\u662f\u7528\u6765\u7ea6\u675f\u90a3\u4e9b\u968f\u4fbf\u76d7\u53d6\u4ed6\u4eba\u52b3\u52a8\u77e5\u8bc6\u6210\u529f\u7684\u5546\u4e1a\u7ad9\u70b9\u3002\u5bf9\u4e8e\uff0c\u4e00\u5fc3\u5411\u5584\uff0c\u81f4\u529b\u4e8e\u63a8\u52a8\u884c\u4e1a\u53d1\u5c55\u7684\u5c0f\u4f19\u4f34\u4eec\uff0c\u53ef\u4ee5\u8054\u7cfb\u6211\u8fdb\u884c\u5f53\u9762\u6388\u6743\u3002<\/p>\n<p>\u5c0a\u91cd\u77e5\u8bc6\u4ea7\u6743\uff0c\u5171\u521b\u548c\u8c10\u793e\u4f1a\uff01<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/mat1.gtimg.com\/www\/mb\/images\/face\/30.gif\" align=\"absmiddle\"><\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u5c0a\u91cd\u8f9b\u52e4\u52b3\u52a8\uff0c\u53ef\u4ee5\u514d\u8d39\u6458\u8981\u3001\u63a8\u8350\u6216\u805a\u5408\uff0c\u4f46\u5b8c\u6574\u8f6c\u8f7d\u9700\u4ed8\u8d39\u8d2d\u4e70\u7248\u6743\uff0c\u8be6\u89c1<a href=\"http:\/\/www.zhangxinxu.com\/sp\/copyright.html\" target=\"_blank\">\u8f6c\u8f7d\u534f\u8bae\u58f0\u660e<\/a><br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"http:\/\/www.zhangxinxu.com\/wordpress\/?p=5474\">http:\/\/www.zhangxinxu.com\/wordpress\/?p=5474<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u901a\u77e5\u53ef\u4ee5\u8bf4\u662fweb\u4e2d\u6bd4\u8f83\u5e38\u89c1\u4e14\u91cd\u8981\u7684\u529f\u80fd\uff0c\u79c1\u4fe1\u3001\u5728\u7ebf\u63d0\u95ee\u3001\u6216\u8005\u4e00\u4e9b\u5728\u7ebf\u5373\u65f6\u901a\u8baf\u5de5\u5177\u6211\u4eec\u603b\u662f\u5e0c\u671b\u7b2c\u4e00\u65f6\u95f4\u77e5\u9053\u5bf9\u65b9\u6709\u4e86\u65b0\u7684\u53cd\u9988\uff0c\u8fd9\u4e2a\u65f6\u5019\uff0c\u5c31\u9700\u8981\u9875\u9762\u7ed9\u4e88\u5373\u4f7f\u7684\u901a\u77e5\u3002<\/p>\n<p>\u5728\u4ee5\u524d\uff0c\u6211\u4eec\u7684\u901a\u77e5\u5b9e\u73b0\u4e3b\u8981\u662f\u901a\u8fc7\u95ea\u70c1\u9875\u9762\u7684\u6807\u9898\u5185\u5bb9\u6765\u5b9e\u73b0\uff0c\u5b9e\u73b0\u539f\u7406\u5176\u5b9e\u5f88\u7b80\u5355\uff0c\u5c31\u662f\u5b9a\u65f6\u5668\u4e0d\u65ad\u4fee\u6539document.title\u7684\u503c\u3002<\/p>\n<p>\u7136\u800c\uff0c\u8fd9\u79cd\u63d0\u793a\u6709\u4e2a\u81f4\u547d\u7684\u7f3a\u9677\uff0c\u5c31\u662f\u7528\u6237\u7684\u6d4f\u89c8\u5668\u8981\u4e00\u76f4\u662f\u5f20\u5f00\u7684\u3002\u6bd4\u65b9\u8bf4\u7528\u6237\u6d4f\u89c8\u5668\u6700\u5c0f\u5316\uff0c\u6807\u9898\u5c31\u770b\u4e0d\u89c1\uff0c\u81ea\u7136\u5c31\u65e0\u6cd5\u53ca\u65f6get\u5230\u6709\u65b0\u6d88\u606f\u7684\u4fe1\u606f\u3002<\/p>\n<p>\u4e0d\u8fc7\u4e0d\u8981\u62c5\u5fc3\uff0cWeb Notification\u5c31\u53ef\u4ee5\u5f88\u597d\u5730\u89e3\u51b3\u4e0a\u9762\u7684\u75db\u70b9&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[295,52,1070,903],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/5474"}],"collection":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/comments?post=5474"}],"version-history":[{"count":0,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/5474\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=5474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=5474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=5474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}