{"id":322167,"date":"2021-04-27T15:00:06","date_gmt":"2021-04-27T15:00:06","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=322167"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=322167","title":{"rendered":"\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 JavaScript-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u041d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043d\u0435\u0434\u043e\u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u0441\u0438\u043b\u0443 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b. \u041f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0431\u0435, \u0447\u0442\u043e \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c JavaScript \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b push-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0439 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0438\u043b\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u043b\u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440. \u041d\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0440\u0435\u0448\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. \u0412 \u044d\u0442\u043e\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0451\u0442 \u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c \u0432 \u0432\u0438\u0434\u0435 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 JavaScript-\u0444\u0430\u0439\u043b\u043e\u0432. \u041f\u0440\u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0435 \u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u0438\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/554286\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3c\/bc\/eb\/3cbceb2ugtao5s0kehapmyoiq38.jpeg\"><\/a><br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2><font color=\"#3AC1EF\">\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Push.js<\/font><\/h2>\n<p>  \u041e\u0434\u043d\u0430\u0436\u0434\u044b \u044f \u043f\u0440\u044f\u043c\u043e-\u0442\u0430\u043a\u0438 \u0441\u0431\u0438\u043b\u0430\u0441\u044c \u0441 \u043d\u043e\u0433 \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043f\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 push-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u0435\u043d\u044f \u0432\u044b\u0440\u0443\u0447\u0438\u043b\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/pushjs.org\/\">Push.js<\/a>, \u0441\u0440\u0435\u0434\u0438 \u0441\u0438\u043b\u044c\u043d\u044b\u0445 \u0441\u0442\u043e\u0440\u043e\u043d \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e, \u043f\u043e\u043d\u044f\u0442\u043d\u0443\u044e \u0434\u0430\u0436\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0435\u043c\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/656\/aa5\/5e7\/656aa55e73c4fc7ba3af980a6fb5b4f5.png\"><\/div>\n<p><i><font color=\"#999999\">\u0421\u0430\u0439\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Push.js<\/font><\/i><\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0435\u0439 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u2014 \u043d\u0430\u0434\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0441 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e HTML-\u0444\u0430\u0439\u043b\u0430. \u0414\u0430\u043b\u0435\u0435 \u2014 \u0435\u0451 \u043d\u0443\u0436\u043d\u043e \u043a \u044d\u0442\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e, \u043b\u0438\u0431\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c NPM-\u043f\u0430\u043a\u0435\u0442\u043e\u043c, \u043b\u0438\u0431\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0432 \u0438\u0437 \u0435\u0451 <a href=\"https:\/\/github.com\/Nickersoft\/push.js\">GitHub-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/a> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u2014 \u0432 \u0432\u0438\u0434\u0435 .zip-\u0430\u0440\u0445\u0438\u0432\u0430. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <code>push.min.js<\/code> \u0438 <code>serviceWorker.min.js<\/code> \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 HTML-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u044d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430:<\/p>\n<pre><code class=\"html\">&lt;body&gt;  \u00a0\u00a0\u00a0\u00a0&lt;script src=&quot;push.min.js&quot;&gt;&lt;\/script&gt; \u00a0\u00a0\u00a0\u00a0&lt;script src=&quot;serviceWorker.min.js&quot;&gt;&lt;\/script&gt;  \u00a0\u00a0\u00a0\u00a0&lt;script&gt; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0function start() { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Push.create(&quot;Hello from Unnati!&quot;, { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0body: &quot;Here's your push notification demo&quot;, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0icon: 'https:\/\/gw.alipayobjects.com\/zos\/antfincdn\/4zAaozCvUH\/unexpand.svg', \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0timeout: 4000, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0onClick: function () { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0window.focus(); \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.close(); \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}); \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0&lt;\/script&gt; \u00a0\u00a0\u00a0\u00a0&lt;h1&gt;Push notification implementation&lt;\/h1&gt; \u00a0\u00a0\u00a0\u00a0&lt;h3&gt;Click on this button to view notification&lt;\/h3&gt; \u00a0\u00a0\u00a0\u00a0&lt;a href=&quot;javascript:void(0)&quot; onclick=&quot;start()&quot;&gt;Start&lt;\/a&gt;  &lt;\/body&gt; <\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/3a7\/c4c\/8bd\/3a7c4c8bda7ecdedc2869f56e1be6b50.png\"><\/div>\n<p>  <i><font color=\"#999999\">\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0430\u044f push.js<\/font><\/i><\/p>\n<h2><font color=\"#3AC1EF\">\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Editor.js<\/font><\/h2>\n<p>  \u0412\u043e\u0442 \u2014 \u0435\u0449\u0451 \u043e\u0434\u043d\u0430 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u2014 <a href=\"https:\/\/editorjs.io\/\">Editor.js<\/a>. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435, \u0430 Editor.js \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0438 \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f JS-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0430\u044f \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e. \u0415\u0451 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c JavaScript, \u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u0445, \u0432\u0440\u043e\u0434\u0435 React. \u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u2014 \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0436\u0438\u0440\u043d\u044b\u043c \u0438\u043b\u0438 \u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u043c, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432 \u0438 \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e \u0435\u0449\u0451. \u0422\u043e\u043c\u0443, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f Editor.js, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0435\u0433\u043b\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0443 \u043d\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0449\u0435\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c. \u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f NPM-\u043f\u0430\u043a\u0435\u0442\u043e\u043c \u0438\u043b\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0435\u0451 \u0441 CDN-\u0440\u0435\u0441\u0443\u0440\u0441\u0430.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/f9d\/f32\/26e\/f9df3226ebc8d372e9ce54a67ba36912.png\"><\/div>\n<p><i><font color=\"#999999\">\u0421\u0430\u0439\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Editor.js<\/font><\/i><\/p>\n<p>  \u0412\u043e\u0442 \u043a\u043e\u0434 \u0444\u0430\u0439\u043b\u0430 <code>index.js<\/code> \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Editor.js:<\/p>\n<pre><code class=\"javascript\">\u00a0\u00a0&lt;body&gt; \u00a0\u00a0\u00a0\u00a0&lt;h1&gt;Enter your content here&lt;\/h1&gt; \u00a0\u00a0\u00a0\u00a0&lt;div id=&quot;editorjs&quot;&gt;&lt;\/div&gt;  \u00a0\u00a0\u00a0\u00a0&lt;button id='button'&gt;Save article&lt;\/button&gt; \u00a0\u00a0\u00a0\u00a0&lt;script src=&quot;https:\/\/cdn.jsdelivr.net\/npm\/@editorjs\/editorjs@latest&quot;&gt;&lt;\/script&gt; \u00a0\u00a0\u00a0\u00a0&lt;script src=&quot;index.js&quot;&gt;&lt;\/script&gt; \u00a0\u00a0&lt;\/body&gt; <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u2014 \u043a\u043e\u0434 <code>index.js<\/code>:<\/p>\n<pre><code class=\"javascript\">try {  \u00a0\u00a0var editor = new EditorJS({ \u00a0\u00a0\u00a0\u00a0holderId : 'editorjs', \u00a0\u00a0\u00a0\u00a0placeholder: 'Let`s write an awesome story!', \u00a0\u00a0\u00a0\u00a0autofocus: true,  \u00a0\u00a0});  \u00a0\u00a0editor.isReady \u00a0\u00a0\u00a0\u00a0.then(() =&gt; { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0console.log(&quot;Editor.js is ready to work!&quot;); \u00a0\u00a0\u00a0\u00a0}) \u00a0\u00a0\u00a0\u00a0.catch((reason) =&gt; { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0console.log(`Editor.js initialization failed because of ${reason}`); \u00a0\u00a0\u00a0\u00a0});  \u00a0\u00a0const btn = document.getElementById(&quot;button&quot;);  \u00a0\u00a0btn.addEventListener(&quot;click&quot;, function () { \u00a0\u00a0\u00a0\u00a0editor.save().then((outputData) =&gt; { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0console.log('Article data: ', outputData) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}).catch((error) =&gt; { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0console.log('Saving failed: ', error) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0});  \u00a0\u00a0}); } catch (reason) { \u00a0\u00a0console.log(`Editor.js initialization failed because of ${reason}`); } <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438, \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0430, \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0435\u0439 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0442\u0430\u043a \u043a\u0430\u043a, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0441 \u043d\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f \u2014 \u044d\u0442\u043e \u0438 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0444\u0430\u0439\u043b\u0430 <code>index.js<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u044f Editor.js \u0432 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043c\u0430\u0441\u0441\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u2014 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432 \u0438 \u0441\u043f\u0438\u0441\u043a\u043e\u0432), \u043e\u0441\u0432\u043e\u0438\u0442\u044c \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e, \u043e\u0431\u0440\u0430\u0442\u0438\u0432\u0448\u0438\u0441\u044c \u043a \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430:<\/p>\n<pre><code class=\"javascript\">import Header from '@editorjs\/header'; import List from '@editorjs\/list'; import MyParagraph from 'my-paragraph.js'; const editor = new EditorJS({  \u00a0\u00a0tools: { \u00a0\u00a0\u00a0\u00a0header: Header, \u00a0\u00a0\u00a0\u00a0list: List, \u00a0\u00a0\u00a0\u00a0myOwnParagraph: MyParagraph \u00a0\u00a0}, \u00a0\u00a0defaultBlock: &quot;myOwnParagraph&quot; }) <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u043a\u0430\u043a \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/973\/0b8\/a6e\/9730b8a6eeec33eeb4d508fdca24a02e.png\"><\/div>\n<p><i><font color=\"#999999\">\u0420\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435<\/font><\/i><\/p>\n<h2><font color=\"#3AC1EF\">\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Howler.js<\/font><\/h2>\n<p>  \u0412\u044b, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 HTML-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0437\u0432\u0443\u043a\u0430\u043c\u0438 \u0438 \u0432\u0438\u0434\u0435\u043e\u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/howlerjs.com\/\">Howler.js<\/a> \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430 \u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u043e \u0437\u0432\u0443\u043a\u043e\u043c. \u041a \u043d\u0435\u0439 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u0430 \u0445\u043e\u0440\u043e\u0448\u0430\u044f <a href=\"https:\/\/github.com\/goldfire\/howler.js#documentation\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/a>.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/bef\/610\/6ef\/bef6106ef80887e93676ffd5e575db48.png\"><\/div>\n<p><i><font color=\"#999999\">\u0421\u0430\u0439\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Howler.js<\/font><\/i><\/p>\n<p>  \u0412\u043e\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430, \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439:<\/p>\n<pre><code class=\"javascript\">&lt;script&gt; \u00a0\u00a0\u00a0\u00a0var sound = new Howl({ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0src: ['sound.webm', 'sound.mp3'] \u00a0\u00a0\u00a0\u00a0}); &lt;\/script&gt; <\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/c92\/ee9\/b32\/c92ee9b32a554546151a07840dfe2a0c.gif\"><\/div>\n<p>  <i><font color=\"#999999\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Howler.js<\/font><\/i><\/p>\n<h2><font color=\"#3AC1EF\">\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Reveal.js<\/font><\/h2>\n<p>  \u0412\u044b \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0437\u0430\u0434\u0443\u043c\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u0441\u0442\u0430\u043d\u0435\u0442 \u0434\u0435\u043d\u044c, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f JavaScript? \u0412 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e, \u044d\u0442\u043e\u0442 \u0434\u0435\u043d\u044c, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 <a href=\"https:\/\/revealjs.com\/\">Reveal.js<\/a>, \u0443\u0436\u0435 \u043d\u0430\u0441\u0442\u0430\u043b. \u042f \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043c\u043e\u0433\u0443 \u043d\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u043d\u0435\u0439.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/2af\/b0e\/bf1\/2afb0ebf1e5bb7b9d75ea178c2d13cb9.png\"><\/div>\n<p><i><font color=\"#999999\">\u0421\u0430\u0439\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Reveal.js<\/font><\/i><\/p>\n<p>  \u0415\u0451, \u043a\u0430\u043a \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 NPM-\u043f\u0430\u043a\u0435\u0442\u0430, \u0438\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0435\u0451 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u0438\u0437 <a href=\"https:\/\/github.com\/hakimel\/reveal.js\">GitHub-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/a> \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 .js \u0438 .css-\u0444\u0430\u0439\u043b\u044b \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.<\/p>\n<p>  \u0412\u043e\u0442 \u0441\u0442\u0438\u043b\u0438 Reveal.js:<\/p>\n<pre><code class=\"css\">&lt;link rel=&quot;stylesheet&quot; href=&quot;dist\/reset.css&quot;&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;dist\/reveal.css&quot;&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;dist\/theme\/black.css&quot; id=&quot;theme&quot;&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;plugin\/highlight\/monokai.css&quot; id=&quot;highlight-theme&quot;&gt; <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f .js-\u0444\u0430\u0439\u043b\u043e\u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u043a\u043e\u0434 \u0435\u0451 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"javascript\">&lt;script src=&quot;dist\/reveal.js&quot;&gt;&lt;\/script&gt; &lt;script src=&quot;plugin\/notes\/notes.js&quot;&gt;&lt;\/script&gt; &lt;script src=&quot;plugin\/markdown\/markdown.js&quot;&gt;&lt;\/script&gt; &lt;script src=&quot;plugin\/highlight\/highlight.js&quot;&gt;&lt;\/script&gt; &lt;script&gt; \u00a0\u00a0\u00a0\u00a0\u00a0Reveal.initialize({ \u00a0\u00a0\u00a0\u00a0hash: true, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0plugins: [ RevealMarkdown, RevealHighlight, RevealNotes ] \u00a0\u00a0\u00a0}); &lt;\/script&gt; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043e \u0441\u043b\u0430\u0439\u0434\u0430\u0445, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u0442 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Reveal.js.<\/p>\n<p>  \u0412 \u0444\u0430\u0439\u043b\u0435 <code>index.html<\/code>, \u0432 \u0442\u0435\u0433\u0435 <code>&lt;body&gt;<\/code>, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <code>&lt;div&gt;<\/code>, \u0438\u043c\u0435\u043d\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>reveal<\/code>, \u0438 \u0432\u043b\u043e\u0436\u0438\u043c \u0432 \u043d\u0435\u0433\u043e \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <code>&lt;div&gt;<\/code>, \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0432 \u0435\u043c\u0443 \u043a\u043b\u0430\u0441\u0441 <code>slides<\/code>. \u0412 \u044d\u0442\u043e\u0442 <code>&lt;div&gt;<\/code> \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b <code>&lt;section&gt;<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0441\u043b\u0430\u0439\u0434\u043e\u0432.<\/p>\n<pre><code class=\"html\">&lt;div class=&quot;reveal&quot;&gt; \u00a0\u00a0&lt;div class=&quot;slides&quot;&gt; \u00a0\u00a0\u00a0&lt;section&gt; \u00a0\u00a0\u00a0\u00a0&lt;h1&gt;Slide 1&lt;\/h1&gt; \u00a0\u00a0\u00a0\u00a0&lt;h3&gt;This is an amazing library&lt;\/h3&gt; \u00a0\u00a0\u00a0&lt;\/section&gt; \u00a0\u00a0&lt;section&gt; \u00a0\u00a0\u00a0&lt;h1&gt;Slide 2&lt;\/h1&gt; \u00a0\u00a0\u00a0&lt;h3&gt;You can just play around with a lot of stuff&lt;\/h3&gt; \u00a0\u00a0&lt;\/section&gt; \u00a0\u00a0&lt;section&gt; \u00a0\u00a0\u00a0&lt;h1&gt;Slide 3&lt;\/h1&gt; \u00a0\u00a0\u00a0&lt;h3&gt;That's it for the slide Show&lt;\/h3&gt; \u00a0\u00a0\u00a0&lt;\/section&gt; \u00a0\u00a0&lt;\/div&gt; &lt;\/div&gt; <\/code><\/pre>\n<p>  <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/779\/1ad\/e44\/7791ade44d5a0d4226f9b6483fa1ea3c.gif\"><\/div>\n<p>  <i><font color=\"#999999\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Reveal.js \u0434\u043b\u044f \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/font><\/i><\/p>\n<h2><font color=\"#3AC1EF\">\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Chart.js<\/font><\/h2>\n<p>  \u041f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043d\u0435\u0440\u0430\u0437\u0440\u044b\u0432\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u0442\u0440\u044f\u0441\u0430\u044e\u0449\u0430\u044f JavaScript-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/www.chartjs.org\/\">Chart.js<\/a>, \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0447\u0430\u0442\u044b\u0435, \u043a\u0440\u0443\u0433\u043e\u0432\u044b\u0435, \u0442\u043e\u0447\u0435\u0447\u043d\u044b\u0435 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u0438\u0434\u043e\u0432.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/cb2\/ee9\/87c\/cb2ee987c916605d6a6dbc212a12d5d0.png\"><\/div>\n<p><i><font color=\"#999999\">\u0421\u0430\u0439\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Chart.js<\/font><\/i><\/p>\n<p>  \u0412\u043e\u0442 \u043a\u043e\u0434, \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u0440\u0443\u0433\u043e\u0432\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Chart.js:<\/p>\n<pre><code class=\"javascript\">var ctx = document.getElementById('myChart').getContext('2d'); \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0var myChart = new Chart(ctx, { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0type: 'pie', \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0data: { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'], \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0datasets: [{ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0label: '# of Votes', \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0data: [12, 19, 3, 5, 2, 3], \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0backgroundColor: [ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'rgba(255, 99, 132, 0.2)', \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'rgba(54, 162, 235, 0.2)', \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'rgba(255, 206, 86, 0.2)', \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'rgba(75, 192, 192, 0.2)', \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'rgba(153, 102, 255, 0.2)', \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'rgba(255, 159, 64, 0.2)' \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0], \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0borderColor: [ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'rgba(255, 99, 132, 1)', \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'rgba(54, 162, 235, 1)', \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'rgba(255, 206, 86, 1)', \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'rgba(75, 192, 192, 1)', \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'rgba(153, 102, 255, 1)', \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0'rgba(255, 159, 64, 1)' \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0], \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0borderWidth: 1 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}] \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0options: { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0scales: { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0y: { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0beginAtZero: true \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}); <\/code><\/pre>\n<p>  \u041a\u0430\u043a\u0438\u043c\u0438 JavaScript-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0432\u044b \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435\u0441\u044c \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445?<\/p>\n<p>  <a href=\"http:\/\/ruvds.com\/ru-rub?utm_source=habr&amp;utm_medium=perevod&amp;utm_campaign=poleznye_javascript_biblioteki\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ou\/g5\/kh\/oug5kh6sjydt9llengsiebnp40w.png\"><\/a><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/554286\/\"> https:\/\/habr.com\/ru\/company\/ruvds\/blog\/554286\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u041d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043d\u0435\u0434\u043e\u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u0441\u0438\u043b\u0443 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b. \u041f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441\u043b\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0431\u0435, \u0447\u0442\u043e \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c JavaScript \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b push-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0439 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0438\u043b\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u043b\u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440. \u041d\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0440\u0435\u0448\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. \u0412 \u044d\u0442\u043e\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0451\u0442 \u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u043c \u0432 \u0432\u0438\u0434\u0435 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 JavaScript-\u0444\u0430\u0439\u043b\u043e\u0432. \u041f\u0440\u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0435 \u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u0438\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/company\/ruvds\/blog\/554286\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/3c\/bc\/eb\/3cbceb2ugtao5s0kehapmyoiq38.jpeg\"><\/a>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-322167","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/322167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=322167"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/322167\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=322167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=322167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=322167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}