{"id":200720,"date":"2013-11-04T07:55:03","date_gmt":"2013-11-04T03:55:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=200720"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=200720","title":{"rendered":"<span class=\"post_title\">\u041f\u0438\u0448\u0435\u043c single-page web application framework \u0432 60 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 \u043a\u043e\u0434\u0430<\/span>"},"content":{"rendered":"<div class=\"content html_format\">\n<h4>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u044f<\/h4>\n<p>  \u0412\u0435\u0431-\u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u0441\u043a\u0438\u0439 \u043d\u0430\u0440\u043e\u0434 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0441\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b single page web applications. \u0427\u0442\u043e \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043e \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445.<br \/>  \u041d\u043e \u044f\u044b\u043d\u043e \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0447\u0442\u043e single page web application \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u0435\u0437 \u0447\u0435\u0433\u043e-\u0442\u043e \u0442\u0438\u043f\u0430 AngularJS, Ember \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 Knockouts. <br \/>  \u0412\u043e \u0432\u0441\u044f\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0442\u0438\u043f\u0430 To-do \u0441\u043f\u0438\u0441\u043a\u0430 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u0449\u0438\u0442\u044c \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442 \u043a\u0438\u043b\u043e\u0431\u0430\u0439\u0442\u044b \u043c\u0435\u0433\u0430-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043a\u0438\u043b\u043e\u0431\u0430\u0439\u0442\u044b \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u044d\u0442\u043e \u043f\u043e\u043b \u0431\u0435\u0434\u044b. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0446\u0435\u043d\u0430, \u0441\u043a\u0430\u0436\u0435\u043c AngularJS, \u0432 \u0442\u043e\u043c \u0447\u0442\u043e \u043e\u043d, \u043a\u0430\u043a \u043b\u044e\u0431\u043e\u0439 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 data binding \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e run-time \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443. <\/p>\n<p>  \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e \u0442\u043e \u043a\u0430\u043a \u0432 60 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 \u043a\u043e\u0434\u0430 + jQuery\/Zepto \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 app framework \u043a\u043e\u0442\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b \u0438 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0438\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443.<\/p>\n<h4>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h4>\n<p>  \u041d\u0430\u0448 framework \u0434\u043e\u043b\u0436\u0435\u043d &#8230;:<\/p>\n<ol>\n<li>\u2026 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c routing, \u0442.\u0435. \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0434\u0435\u043a\u043b\u0430\u0440\u0442\u0438\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438: \u00ab\u044d\u0442\u043e\u0442 \u0432\u043e\u0442 url hash \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u0432 \u044d\u0442\u043e\u043c view\u00bb.<\/li>\n<li>\u0414\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 view. \u041a\u0430\u043a\u0438\u0435-\u0442\u043e \u0447\u0430\u0441\u0442\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043b\u0438\u0431\u043e \u0442\u044f\u0436\u0435\u043b\u044b \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043b\u0438\u0431\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043d\u0435\u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/li>\n<li>\u0414\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432. \u041f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c \u0432 \u043f. 2<\/li>\n<li>\u041d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c browsing history \u2014 \u043a\u043d\u043e\u043f\u043a\u0430 \u00ab\u043d\u0430\u0437\u0430\u0434\u00bb \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438 \u0442.\u0434. <\/li>\n<li>\u041d\u0443 \u0438 \u0432\u0441\u0435 \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u043c \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u044b\u043c \u043a\u0430\u043a \u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/li>\n<\/ol>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c<\/h4>\n<p>  \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <a href=\"http:\/\/terrainformatica.com\/tests\/app\/index.htm\">Bootstrap&#8217;\u043d\u0443\u0442\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432<\/a> \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0430\u043c \u0441\u043f\u0438\u0441\u043e\u043a, \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0443 \u2014 \u0434\u0435\u0442\u0430\u043b\u0438 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430 \u0438 \u043d\u0435\u043a\u0443\u044e \u043f\u0430\u043d\u0435\u043b\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f (dashboard). \u0427\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 \u0442\u043e\u0439 \u043f\u0430\u043d\u0435\u043b\u0438 \u043d\u0430\u043c \u043d\u0435 \u0432\u0430\u0436\u043d\u043e \u2014 \u0437\u043d\u0430\u0435\u043c \u0447\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438 \u043b\u0430\u0434\u043d\u043e. <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/d76\/49b\/801\/d7649b8018f0e2812b70aa6ead41e2c3.jpg\" alt=\"Personas demo\"\/><\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c <a name=\"habracut\"><\/a><\/p>\n<h4>\u041f\u043e\u0435\u0445\u0430\u043b\u0438&#8230;<\/h4>\n<p>  Single page web application \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e, html \u0444\u0430\u0439\u043b\u0430. \u041d\u043e \u043f\u043e \u0434\u0438\u0437\u0430\u0439\u043d\u0443 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u044f\u0432\u043d\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u043d\u044b\u0435 \u0441\u0443\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438\u043b\u0438 views. \u0414\u043e\u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0441\u0430\u043c\u0438 \u0441 \u0441\u043e\u0431\u043e\u0439 \u0447\u0442\u043e \u044d\u0442\u0438 \u0441\u0443\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043f\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b  \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c markup:<\/p>\n<pre><code class=\"html\">&lt;body&gt;     ...     &lt;section id=dashboard class=&quot;container&quot; src=&quot;pages\/dashboard.htm&quot;&gt;&lt;\/section&gt;     &lt;section id=about class=&quot;container&quot; src=&quot;pages\/about.htm&quot;&gt;&lt;\/section&gt;     &lt;section id=contact class=&quot;container&quot; src=&quot;pages\/contact.htm&quot;&gt;&lt;\/section&gt;     &lt;section id=contacts class=&quot;container&quot; src=&quot;pages\/contacts.htm&quot;&gt;&lt;\/section&gt;     ... &lt;\/body&gt; <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043a\u0440\u043e\u043c\u0435 \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e src \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 (\u0434\u043b\u044f section \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430). <br \/>  \u0414\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c\u0441\u044f \u0447\u0442\u043e src \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0431\u0443\u0434\u0435\u0442 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 html \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e view. \u0422\u0430\u043a\u0438\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043f\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u043d\u0438\u044e \u0442.\u0435. \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430 \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u043f\u0440\u043e\u0441\u0438\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u0442\u043e\u0442 view.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0441 \u043d\u0430\u0448\u0438\u043c \u0432\u0435\u0431-\u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u043e\u043c \u0447\u0442\u043e section \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043a\u043b\u0430\u0441\u0441 active \u0431\u0443\u0434\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u043c \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u0438\u0434\u0438\u043c\u044b\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u043e CSS \u043f\u0440\u0430\u0432\u0438\u043b\u043e:<\/p>\n<pre><code class=\"css\">\/* section visibility *\/ body &gt; section:not(.active) { display:none; } <\/code><\/pre>\n<h5>routing<\/h5>\n<p>  \u0414\u043e\u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0447\u0442\u043e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0433\u0438\u043f\u0435\u0440\u043b\u0438\u043d\u043a\u0438 \u0432\u0438\u0434\u0430  <\/p>\n<ul>\n<li><code>href=&quot;#\u0438\u043c\u044f-\u0441\u0435\u043a\u0446\u0438\u0438&quot;<\/code> \u0438.\u0438\u043b\u0438<\/li>\n<li><code>href=&quot;#\u0438\u043c\u044f-\u0441\u0435\u043a\u0446\u0438\u0438:\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440-\u043e\u0431\u044a\u0435\u043a\u0442\u0430&quot;<\/code><\/li>\n<\/ul>\n<p>  \u0422.\u0435. \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0433\u0438\u043f\u0435\u0440\u043b\u0438\u043d\u043a\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c section \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441 id=\u00ab\u0438\u043c\u044f-\u0441\u0435\u043a\u0446\u0438\u0438\u00bb.<br \/>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0433\u0438\u043f\u0435\u0440\u043b\u0438\u043d\u043a\u043e\u0432 \u0434\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u0430 \u0447\u0430\u0441\u0442\u0435\u0439 \u0434\u0430\u0435\u0442 \u043d\u0430\u043c \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 (\u043a\u043d\u043e\u043f\u043a\u0438 \u00ab\u0432\u043f\u0435\u0440\u0435\u0434\u00bb \u0438 \u00ab\u043d\u0430\u0437\u0430\u0434\u00bb). <\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0433\u043e\u0442\u043e\u0432\u044b\u0439 hashchange() jQuery \u043f\u043b\u0430\u0433\u0438\u043d \u043d\u043e \u0435\u0441\u043b\u0438 \u0446\u0435\u043b\u0435\u0432\u044b\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0447\u0442\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f jQuery2 \u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e event handler \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0441\u0432\u0443\u044e\u0449\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0438.<\/p>\n<h5>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u043e\u0439 \u00ab\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b\u00bb-\u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430<\/h5>\n<p>  \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c \u0438\u0437 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 (\u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e HTML) \u0438 script \u0441\u0435\u043a\u0446\u0438\u0438 \u2014 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043d\u0430\u0448\u0435\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 <br \/>  pages\/contact.htm \u2014 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430 \u0434\u043b\u044f \u043f\u043e\u043a\u0430\u0437\u0430 \/ \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430.<\/p>\n<pre><code class=\"html\"> &lt;form class=&quot;form-horizontal&quot; role=&quot;form&quot; name=&quot;contactDetails&quot;&gt;  ...  &lt;\/form&gt;  &lt;script&gt;   app.handler(function() { \/\/| \/\/| view initialization: \/\/|     var $page = $(this);     var $firstName  = $(&quot;[name=firstName]&quot;);     var $lastName   = $(&quot;[name=lastName]&quot;);     ... \/\/| \/\/| view presentation: \/\/|     return function(param) {       var contact = data.contacts[param];       $firstName.val(contact.firstName);       $lastName.val(contact.lastName);       ...     };   });  &lt;\/script&gt;  <\/code><\/pre>\n<p>  \u0412\u044b\u0437\u043e\u0432 `app.handler(function() {&#8230;})` \u0432 \u043a\u043e\u0434\u0435 \u0432\u044b\u0448\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043d\u0430\u0448 view \u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e-\u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043e view.<\/p>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u043e\u0442 \u0438 \u0432\u0441\u0435. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a\u043e\u0434 \u043d\u0430\u0448\u0435\u0433\u043e app framework \u2014 \u0442\u0435 \u0441\u0430\u043c\u044b\u0435 60 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u0442\u043e \u0432\u0441\u0435 \u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u044e\u0442 \u0432\u043c\u0435\u0441\u0442\u0435 (\u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c)<br \/>  <habracut\/><\/p>\n<p>  \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0442\u0443\u0442 \u0432\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u043e\u0441\u043e\u0431\u044b\u0445 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432. \u041d\u043e \u0435\u0441\u043b\u0438 \u0447\u0442\u043e \u2014 \u0441\u0432\u0438\u0441\u0442\u0438\u043c, \u043d\u0435 \u0441\u0442\u0435\u0441\u043d\u044f\u0435\u043c\u0441\u044f.<\/p>\n<pre><code class=\"javascript\">\/\/ Simple single page application framework \/\/ Author: andrew @ terrainformatica.com  (function($,window){    var pageHandlers = {};   var currentPage;      \/\/ show the &quot;page&quot; with optional parameter   function show(pageName,param) {      \/\/ invoke page handler     var ph = pageHandlers[pageName];      if( ph ) {        var $page = $(&quot;section#&quot; + pageName);       ph.call( $page.length ? $page[0] : null,param ); \/\/ call &quot;page&quot; handler     }     \/\/ activate the page       $(&quot;.nav li.active&quot;).removeClass(&quot;active&quot;);     $(&quot;.nav li a[href=#&quot;+pageName+&quot;]&quot;).closest(&quot;li&quot;).addClass(&quot;active&quot;);          $(document.body).attr(&quot;page&quot;,pageName)                     .find(&quot;section&quot;).removeClass(&quot;active&quot;)                     .filter(&quot;section#&quot; + pageName).addClass(&quot;active&quot;);   }      \/\/ &quot;page&quot; loader   function app(pageName,param) {        var $page = $(document.body).find(&quot;section#&quot; + pageName);            var src = $page.attr(&quot;src&quot;);     if( src && $page.find(&quot;&gt;:first-child&quot;).length == 0) {        $.get(src, &quot;html&quot;) \/\/ it has src and is empty - load it           .done(function(html){ currentPage = pageName; $page.html(html); show(pageName,param); })           .fail(function(){ $page.html(&quot;failed to get:&quot; + src); });     } else       show(pageName,param);   }    \/\/ register page handler     app.handler = function(handler) {     var $page = $(document.body).find(&quot;section#&quot; + currentPage);       pageHandlers[currentPage] = handler.call($page[0]);   }      function onhashchange()    {     var hash = location.hash || &quot;#dashboard&quot;;          var re = \/#([-0-9A-Za-z]+)(\\:(.+))?\/;     var match = re.exec(hash);     hash = match[1];     var param = match[3];     app(hash,param); \/\/ navigate to the page   }      $(window).hashchange( onhashchange ); \/\/ attach hashchange handler      window.app = app; \/\/ setup the app as global object      $(function(){ $(window).hashchange() }); \/\/ initial state setup  })(jQuery,this);  <\/code><\/pre>\n<p>  \u0412\u0441\u0451 \u0432\u044b\u0448\u0435\u0438\u0437\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435 \u0435\u0441\u0442\u044c \u0432\u044b\u0436\u0438\u043c\u043a\u0430 \u0438\u0437 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e framework \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 mobile web applications. <br \/>  \u0412 mobile \u0441\u043b\u0443\u0447\u0430\u0435 app \u0440\u043e\u0430\u0441\u0448\u0438\u0440\u0435\u043d \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 app.getData() \u0438 app.postData() \u2014 \u043e\u0431\u0451\u0440\u0442\u043a\u0438 \u043d\u0430\u0434 $.ajax() \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0435 caching \u0432 localStorage \u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f views. \u042d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u044f \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u043d\u0430 \u0432\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439.    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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=\"http:\/\/habrahabr.ru\/post\/200720\/\"> http:\/\/habrahabr.ru\/post\/200720\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">\n<h4>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u044f<\/h4>\n<p>  \u0412\u0435\u0431-\u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u0441\u043a\u0438\u0439 \u043d\u0430\u0440\u043e\u0434 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0441\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b single page web applications. \u0427\u0442\u043e \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043e \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445.<br \/>  \u041d\u043e \u044f\u044b\u043d\u043e \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0447\u0442\u043e single page web application \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u0435\u0437 \u0447\u0435\u0433\u043e-\u0442\u043e \u0442\u0438\u043f\u0430 AngularJS, Ember \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 Knockouts. <br \/>  \u0412\u043e \u0432\u0441\u044f\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0442\u0438\u043f\u0430 To-do \u0441\u043f\u0438\u0441\u043a\u0430 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u0449\u0438\u0442\u044c \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442 \u043a\u0438\u043b\u043e\u0431\u0430\u0439\u0442\u044b \u043c\u0435\u0433\u0430-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043a\u0438\u043b\u043e\u0431\u0430\u0439\u0442\u044b \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u044d\u0442\u043e \u043f\u043e\u043b \u0431\u0435\u0434\u044b. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0446\u0435\u043d\u0430, \u0441\u043a\u0430\u0436\u0435\u043c AngularJS, \u0432 \u0442\u043e\u043c \u0447\u0442\u043e \u043e\u043d, \u043a\u0430\u043a \u043b\u044e\u0431\u043e\u0439 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 data binding \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e run-time \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443. <\/p>\n<p>  \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e \u0442\u043e \u043a\u0430\u043a \u0432 60 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 \u043a\u043e\u0434\u0430 + jQuery\/Zepto \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 app framework \u043a\u043e\u0442\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b \u0438 \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0438\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443.<\/p>\n<h4>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h4>\n<p>  \u041d\u0430\u0448 framework \u0434\u043e\u043b\u0436\u0435\u043d &#8230;:<\/p>\n<ol>\n<li>\u2026 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c routing, \u0442.\u0435. \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u0434\u0435\u043a\u043b\u0430\u0440\u0442\u0438\u0432\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438: \u00ab\u044d\u0442\u043e\u0442 \u0432\u043e\u0442 url hash \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u0432 \u044d\u0442\u043e\u043c view\u00bb.<\/li>\n<li>\u0414\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 view. \u041a\u0430\u043a\u0438\u0435-\u0442\u043e \u0447\u0430\u0441\u0442\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043b\u0438\u0431\u043e \u0442\u044f\u0436\u0435\u043b\u044b \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043b\u0438\u0431\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u044b \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043d\u0435\u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/li>\n<li>\u0414\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432. \u041f\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c \u0432 \u043f. 2<\/li>\n<li>\u041d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c browsing history \u2014 \u043a\u043d\u043e\u043f\u043a\u0430 \u00ab\u043d\u0430\u0437\u0430\u0434\u00bb \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438 \u0442.\u0434. <\/li>\n<li>\u041d\u0443 \u0438 \u0432\u0441\u0435 \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u043c \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u044b\u043c \u043a\u0430\u043a \u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/li>\n<\/ol>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c<\/h4>\n<p>  \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <a href=\"http:\/\/terrainformatica.com\/tests\/app\/index.htm\">Bootstrap&#8217;\u043d\u0443\u0442\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043e\u0432<\/a> \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0430\u043c \u0441\u043f\u0438\u0441\u043e\u043a, \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0443 \u2014 \u0434\u0435\u0442\u0430\u043b\u0438 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430 \u0438 \u043d\u0435\u043a\u0443\u044e \u043f\u0430\u043d\u0435\u043b\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f (dashboard). \u0427\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 \u0442\u043e\u0439 \u043f\u0430\u043d\u0435\u043b\u0438 \u043d\u0430\u043c \u043d\u0435 \u0432\u0430\u0436\u043d\u043e \u2014 \u0437\u043d\u0430\u0435\u043c \u0447\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438 \u043b\u0430\u0434\u043d\u043e. <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/d76\/49b\/801\/d7649b8018f0e2812b70aa6ead41e2c3.jpg\" alt=\"Personas demo\"\/><\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c <\/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-200720","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/200720","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=200720"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/200720\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=200720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=200720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=200720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}