{"id":169577,"date":"2013-02-15T17:45:03","date_gmt":"2013-02-15T13:45:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=169577"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=169577","title":{"rendered":"<span class=\"post_title\">\u0412\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f HTML \u043a\u0430\u043a \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041a\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c JavaScript \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0438\u0445 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440, \u0438 \u0432\u0441\u0435 \u0441\u043f\u043e\u0440\u044b \u0432\u0435\u0434\u0443\u0442\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0432\u0438\u0434\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430. \u041d\u0430\u0448 \u0432\u044b\u0431\u043e\u0440 \u043f\u0440\u043e\u0441\u0442\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e HTML (\u0441 \u0445\u043e\u043b\u0441\u0442\u043e\u043c \u0438\u043b\u0438 \u0431\u0435\u0437) \u0434\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e SVG \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Flash \u043f\u043b\u0435\u0435\u0440\u0430.<\/p>\n<p>  \u0412\u044b\u0431\u0440\u0430\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438 \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e: SVG \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u0434\u043b\u044f \u0441\u0445\u0435\u043c \u0438\u043b\u0438 \u043f\u043b\u0430\u043d\u043e\u0432 \u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u0438, \u0445\u043e\u043b\u0441\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u041e\u0434\u043d\u0430\u043a\u043e, \u043e\u0431\u0430 \u044d\u0442\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u00ab\u043e\u0442\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u00bb \u0441\u0435\u0431\u044f \u043e\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u041f\u043e\u0434 \u00ab\u043e\u0442\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c\u00bb \u044f \u0438\u043c\u0435\u044e \u0432\u0432\u0438\u0434\u0443 \u0442\u043e, \u0447\u0442\u043e \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 \u044d\u0442\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0438\u0434\u0430 \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u0440\u0435\u0432\u043e\u043c \u0438\u043b\u0438 \u0441\u043f\u0438\u0441\u043a\u043e\u043c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0440\u0437\u0438\u043d\u0430 \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044f \u0438\u043b\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441), \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 HTML \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0433\u043b\u043e \u0431\u044b \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h4>\u0412\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0443\u0436\u0435 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435<\/h4>\n<p>  HTML \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u2014 \u044d\u0442\u043e, \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442, \u0430 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0437\u043d\u0430\u0447\u0438\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441\u0430\u043c\u0430 \u043f\u043e \u0441\u0435\u0431\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u0415\u0441\u043b\u0438 \u0443\u0447\u0435\u0441\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 &#8216;data&#8217; \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0451 \u0447\u0442\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0439. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u043c\u043e\u0436\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u00ab\u043a\u0430\u043a \u0435\u0441\u0442\u044c\u00bb \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0422\u0430\u043a \u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438 \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440: \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u00ab\u043a\u0430\u043a \u0435\u0441\u0442\u044c\u00bb \u0438 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 XSLT \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f XML \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430, \u0438\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a \u201c\u0440\u043e\u0434\u043d\u0443\u044e\u201d \u0432\u0435\u0431-\u0444\u043e\u0440\u043c\u0443, \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c JSON.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430; \u043d\u0430 \u043d\u0435\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043f\u043e\u043b\u043a\u0430 \u0441 \u0442\u043e\u0432\u0430\u0440\u0430\u043c\u0438 \u0438 \u043a\u043e\u0440\u0437\u0438\u043d\u043a\u0430 \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0441\u043f\u0438\u0441\u043a\u043e\u043c.<\/p>\n<pre><code class=\"html\">&lt;ul id=&quot;store-shelf&quot;&gt;     &lt;li data-article=&quot;apple&quot;&gt;Apple&lt;\/li&gt;     &lt;li data-article=&quot;milk&quot;&gt;Milk&lt;\/li&gt;     &lt;li data-article=&quot;cacke&quot;&gt;Cacke&lt;\/li&gt;     &lt;li data-topping=&quot;cherry&quot; data-topping-article=&quot;cacke&quot;&gt;Cherry Topping&lt;\/li&gt;     &lt;li data-topping=&quot;cream&quot; data-topping-article=&quot;cacke&quot;&gt;Cream Topping&lt;\/li&gt; &lt;\/ul&gt;  &lt;ul id=&quot;shop-cart&quot;&gt;&lt;\/ul&gt;  &lt;input name=&quot;reset&quot; type=&quot;button&quot; value=&quot;Reset&quot;\/&gt; &lt;input name=&quot;submit&quot; type=&quot;button&quot; value=&quot;Submit&quot;\/&gt; <\/code><\/pre>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u043d\u0430 \u043f\u043e\u043b\u043a\u0430\u0445 \u2014 \u044d\u0442\u043e \u044f\u0431\u043b\u043e\u043a\u0438, \u043c\u043e\u043b\u043e\u043a\u043e \u0438 \u0442\u043e\u0440\u0442\u044b, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043d\u0430 \u043f\u043e\u043b\u043a\u0430\u0445 \u043b\u0435\u0436\u0430\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u0432\u0430\u0440\u044b (\u043e\u043f\u0446\u0438\u0438), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0442\u043e\u0432\u0430\u0440\u0430\u043c\u0438 \u0438 \u043d\u0435 \u043a\u043e \u0432\u0441\u0435\u043c \u0438\u0437 \u043d\u0438\u0445 (\u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u043e\u0440\u0442 \u0441\u043e \u0441\u043b\u0438\u0432\u043a\u0430\u043c\u0438 \u0438\u043b\u0438 \u0432\u0438\u0448\u043d\u0435\u0439, \u0438\u043b\u0438 \u0441 \u0442\u0435\u043c \u0438 \u0434\u0440\u0443\u0433\u0438\u043c). \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0442\u043e\u0432\u0430\u0440\u0430\u0445 \u0438 \u0438\u0445 \u0432\u0437\u0430\u0438\u043c\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0438 \u0435\u0451 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 JavaScript.<\/p>\n<h4>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438<\/h4>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e jQuery UI \u0438 \u043d\u0430\u0447\u043d\u0451\u043c \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0442\u044c \u0442\u043e\u0432\u0430\u0440\u044b \u0441 \u043f\u043e\u043b\u043a\u0438 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u043a\u0443.<\/p>\n<pre><code class=\"javascript\">$(&quot;#shop-cart&quot;).droppable({     accept: 'li[data-article]',     activeClass: 'active',     hoverClass: 'hover',     drop: shopCartDropHandler }); $('#store-shelf li').draggable({     cursor: 'pointer',     revert: true,     stack: 'li' }); function shopCartDropHandler(event, ui) {     var clone, counter, $this = $(this),         article = ui.draggable.attr('data-article'),         existingGoods = $this.children('[data-article=&quot;' +                                article + '&quot;]:not(:has([data-topping]))');          if (existingGoods.length) {         counter = existingGoods.find('input[name=&quot;quantity&quot;]');         counter.val(parseInt(counter.val()) + 1);     } else {         counter = $('&lt;input name=&quot;quantity&quot; type=&quot;number&quot; value=&quot;1&quot; min=&quot;1&quot;\/&gt;');         clone = ui.draggable.clone().css({left: 0, top: 0}).append(counter);         clone.droppable({             accept: 'li[data-topping-article=&quot;' + article + '&quot;]',             activeClass: 'active',             hoverClass: 'hover',             drop: shopCartItemDropHandler         });         $this.append(clone);     } } function shopCartItemDropHandler(event, ui) {     var span, $this = $(this),         topping = ui.draggable.attr('data-topping'),         toppingName = ui.draggable.text(),         existingToppings = $this.find('span[data-topping=&quot;' + topping + '&quot;]');          if (!existingToppings.length) {         span = $('&lt;span\/&gt;').attr('data-topping', topping).text(toppingName);         $this.append(span);     } } <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u0443\u044e \u201c\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0443\u201d (\u0435\u0441\u043b\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0443\u0436\u0435 \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d, \u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0447\u0451\u0442\u0447\u0438\u043a) \u0438 \u0432\u0432\u0435\u043b\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0434\u0432\u0443\u0445 \u0442\u0438\u043f\u043e\u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432: \u0442\u043e\u0432\u0430\u0440 \u0438 \u043e\u043f\u0446\u0438\u044f. \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0431\u0435\u0440\u0451\u043c \u0441\u0435\u0431\u0435 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u0441 \u043f\u043e\u043a\u0443\u043f\u043a\u0430\u043c\u0438. \u0415\u0441\u043b\u0438 \u0432\u0437\u044f\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441 \u043a\u043e\u0440\u0437\u0438\u043d\u043e\u0439, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0435\u0451 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435; \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430\u0445 \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 (\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u2014 \u044d\u0442\u043e \u0438\u043d\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0438 \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0435\u0433\u043e \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c). \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u043a\u043e\u0440\u0437\u0438\u043d\u044b (\u0441\u0442\u0438\u043b\u0438 \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0435\u0441\u044f \u043a jQueryUI \u043e\u043f\u0443\u0449\u0435\u043d\u044b).<\/p>\n<pre><code class=\"html\">&lt;ul id=&quot;shop-cart&quot; class=&quot;ui-droppable&quot;&gt;     &lt;li data-article=&quot;cacke&quot;&gt;Cacke         &lt;input name=&quot;quantity&quot; type=&quot;number&quot; value=&quot;2&quot; min=&quot;1&quot;&gt;         &lt;span data-topping=&quot;cherry&quot;&gt;Cherry Topping&lt;\/span&gt;         &lt;span data-topping=&quot;cream&quot;&gt;Cream Topping&lt;\/span&gt;     &lt;\/li&gt;     &lt;li data-article=&quot;cacke&quot;&gt;Cacke         &lt;input name=&quot;quantity&quot; type=&quot;number&quot; value=&quot;1&quot; min=&quot;1&quot;&gt;         &lt;span data-topping=&quot;cherry&quot;&gt;Cherry Topping&lt;\/span&gt;     &lt;\/li&gt;     &lt;li data-article=&quot;milk&quot;&gt;Milk        &lt;input name=&quot;quantity&quot; type=&quot;number&quot; value=&quot;2&quot; min=&quot;1&quot;&gt;     &lt;\/li&gt;     &lt;li data-article=&quot;apple&quot;&gt;Apple         &lt;input name=&quot;quantity&quot; type=&quot;number&quot; value=&quot;1&quot; min=&quot;1&quot;&gt;     &lt;\/li&gt; &lt;\/ul&gt; <\/code><\/pre>\n<p>  \u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0437\u0430\u043a\u0430\u0437 \u043d\u0430 \u0442\u0440\u0438 \u0442\u043e\u0440\u0442\u0430 (\u0434\u0432\u0430 \u0441\u043e \u0441\u043b\u0438\u0432\u043a\u0430\u043c\u0438 \u0438 \u0432\u0438\u0448\u043d\u0435\u0439 \u0438 \u043e\u0434\u0438\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0432\u0438\u0448\u043d\u0435\u0439), \u0434\u0432\u0435 \u043f\u043e\u0440\u0446\u0438\u0438 \u043c\u043e\u043b\u043e\u043a\u0430 \u0438 \u043e\u0434\u043d\u043e \u044f\u0431\u043b\u043e\u043a\u043e.<br \/>  \u041e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441: \u043a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043a\u0430\u043a \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0438\u0445 \u043e\u0431\u0440\u0430\u0442\u043d\u043e. \u0414\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443 (\u0447\u0430\u0441\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 &#8216;data&#8217; \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u0441\u043a\u0440\u044b\u0442\u044b\u0435 \u043f\u043e\u043b\u044f \u0432\u0432\u043e\u0434\u0430), \u043b\u0438\u0431\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c Ajax \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 JSON \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u0412\u044b\u0431\u043e\u0440 \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0433\u043e\u0442\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b: \u0432\u0435\u0431-\u0444\u043e\u0440\u043c\u0430 \u043f\u043b\u043e\u0445\u043e \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440. \u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u0432\u0430 \u0443\u0440\u043e\u0432\u043d\u044f \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 (\u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0441 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0438 \u043d\u0430\u0431\u043e\u0440 \u043e\u043f\u0446\u0438\u0439), \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c JSON.<\/p>\n<p>  \u041f\u0440\u043e\u0441\u0442\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c JSON, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e DOM \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u044b \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u043c \u201c\u044f\u0440\u043b\u044b\u043a\u0438\u201d \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0442\u043e\u0432\u0430\u0440\u043e\u0432 \u0438 \u043e\u043f\u0446\u0438\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0430 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u0435\u0433\u043a\u043e \u0438 \u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u043d\u043e \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/p>\n<pre><code class=\"javascript\">$('input[name=&quot;submit&quot;]').click(function () {     var result = {items: []};      shopCart.find('li[data-article]').each(function () {         var $this = $(this),             toppings = [],             article = { id: $this.attr('data-article') },             quantity = $this.find('input[name=&quot;quantity&quot;]').val();                  $this.find('span[data-topping]').each(function () {             toppings.push({ id: $(this).attr('data-topping') });         });         result.items.push({             article: article,             toppings: toppings,             quantity: parseInt(quantity)         });     });      $.ajax('\/shopping-cart\/webresources\/cart', {         cache: false,         contentType: 'application\/json',         data: JSON.stringify(result),         dataType: 'json',         type: 'POST'     }); }); <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f: \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438 \u0432\u044b\u0434\u0430\u0447\u0430 \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0439 Glassfish \u0438 Jersey \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0435\u0431-\u0441\u043b\u0443\u0436\u0431, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 JSON. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c REST \u0441\u0435\u0440\u0432\u0438\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u043f\u0440\u0438 POST \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0438 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043a\u0443\u043f\u043e\u043a \u043f\u0440\u0438 GET \u0437\u0430\u043f\u0440\u043e\u0441\u0435. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043e\u0434\u0438\u043d \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0442\u043e\u0432\u0430\u0440\u044b \u0438 \u043e\u043f\u0446\u0438\u0438 \u043d\u0430 \u043f\u043e\u043b\u043a\u0435 \u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043a\u043e\u0440\u0437\u0438\u043d\u0443. \u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u044d\u0442\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u043e\u0437\u044c\u043c\u0451\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"java\">@Path(&quot;cart&quot;) @Singleton @ApplicationScoped public class ShoppingResource {      @Inject private Storage storage;     @GET @Produces(MediaType.APPLICATION_JSON)     public ShoppingCart get() { eturn storage.getShoppingCart(); }          @POST @Consumes(MediaType.APPLICATION_JSON)     public void post(ShoppingCart shoppingCart) { storage.setShoppingCart(shoppingCart);} }  @Named @Singleton @ApplicationScoped public class Storage {     private final Map&lt;String, Article&gt; articles = new HashMap&lt;&gt;();     private final Map&lt;String, Topping&gt; toppings = new HashMap&lt;&gt;();     private ShoppingCart shoppingCart;          @PostConstruct public void init() {         Article cacke = new Article(&quot;cacke&quot;, &quot;Cacke&quot;);         putArticles(cacke, new Article(&quot;milk&quot;, &quot;Milk&quot;), new Article(&quot;apple&quot;, &quot;Apple&quot;));         putToppings(             new Topping(&quot;cream&quot;, &quot;Cream Topping&quot;, cacke),             new Topping(&quot;cherry&quot;, &quot;Cherry Topping&quot;, cacke));     }     private void putArticles(Article... articles) {         for (Article article : articles) { his.articles.put(article.getId(), article); }     }     private void putToppings(Topping... toppings) {         for (Topping topping : toppings) { this.toppings.put(topping.getId(), topping); }     }      @PreDestroy public void clear() { articles.clear(); toppings.clear(); }      public Collection&lt;Article&gt; getArticles() { return articles.values(); }     public Collection&lt;Topping&gt; getToppings() { return toppings.values(); }     public ShoppingCart getShoppingCart() { return shoppingCart;    }          public void setShoppingCart(ShoppingCart shoppingCart) {         ensureConsistence(shoppingCart);         this.shoppingCart = shoppingCart;     }     private void ensureConsistence(ShoppingCart cart) { \/*         \u0417\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u201c\u043d\u0435\u043f\u043e\u043b\u043d\u044b\u0435\u201d \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0435 \u043d\u0430 \u201c\u043f\u043e\u043b\u043d\u044b\u0435\u201d \u0438\u0437 \u0431\u0430\u0437\u044b      *\/ } } <\/code><\/pre>\n<p>  \u041d\u0430\u043c \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u0440\u0437\u0438\u043d\u044b. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043e\u0431\u0449\u0438\u0439 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0447\u0442\u0435\u043d\u0438\u044e\/\u0437\u0430\u043f\u0438\u0441\u0438 \u0442\u043e\u0432\u0430\u0440\u043e\u0432, \u043e\u043f\u0446\u0438\u0439 \u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u044b \u0438\u0437 JSON \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u0435.<\/p>\n<pre><code class=\"java\">@Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public abstract class JsonProvider&lt;T&gt;     implements MessageBodyReader&lt;T&gt;, MessageBodyWriter&lt;T&gt; {      private static final Logger LOGGER = Logger.getLogger(JsonProvider.class.getName());     private final ConcurrentMap&lt;T, byte[]&gt; serializedMap = new ConcurrentHashMap&lt;&gt;();     private final ObjectMapper mapper = new ObjectMapper();      protected final ObjectMapper getMapper() { return mapper; }     protected abstract Class&lt;T&gt; getType();      \/\/ Reader Implementation      @Override     public final boolean isReadable(Class&lt;?&gt; type, Type type1, Annotation[] antns, MediaType mt) {                  return mt.equals(MediaType.APPLICATION_JSON_TYPE)             && getMapper().canDeserialize(getJavaType())             && getType().isAssignableFrom(type);     }     private JavaType getJavaType() {         return TypeFactory.fromClass(getType());     }      @Override     public T readFrom(Class&lt;T&gt; type, Type type1, Annotation[] antns,  MediaType mt, MultivaluedMap&lt;String, String&gt; mm, InputStream in)             throws IOException, WebApplicationException {          return (T) getMapper().readValue(in, getClass());     }      \/\/ Writer Implementation      @Override     public final boolean isWriteable(Class&lt;?&gt; type, Type type1, Annotation[] antns, MediaType mt) {         return mt.equals(MediaType.APPLICATION_JSON_TYPE)             && getMapper().canSerialize(getType())             && getType().isAssignableFrom(type);     }     @Override     public final long getSize(T t, Class&lt;?&gt; type, Type type1, Annotation[] antns, MediaType mt) {         byte[] result = new byte[0];         try {             ByteArrayOutputStream stream = new ByteArrayOutputStream();             getMapper().writeValue(stream, t);             result = stream.toByteArray();             serializedMap.put(t, result);         } catch (IOException ex) {             LOGGER.log(Level.SEVERE, null, ex);         }         return result.length;     }     @Override     public final void writeTo(T t, Class&lt;?&gt; type, Type type1, Annotation[] antns, MediaType mt, MultivaluedMap&lt;String, Object&gt; mm, OutputStream out)         throws IOException, WebApplicationException {          if (serializedMap.containsKey(t)) {             byte[] data = serializedMap.remove(t);             out.write(data);         }         out.flush();     } } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0440\u0437\u0438\u043d\u044b \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c JSON, \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0437 DOM, \u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 HTML \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0438\u0437 \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<pre><code class=\"xml\">&lt;ul id=&quot;store-shelf&quot;&gt;     &lt;c:forEach var=&quot;article&quot; items=&quot;#{storage.articles}&quot;&gt;         &lt;li data-article=&quot;${article.id}&quot;&gt;${article.name}&lt;\/li&gt;     &lt;\/c:forEach&gt;     &lt;c:forEach var=&quot;topping&quot; items=&quot;#{storage.toppings}&quot;&gt;         &lt;li data-topping=&quot;${topping.id}&quot;                             data-topping-article=&quot;${topping.article.id}&quot;&gt;${topping.name}&lt;\/li&gt;     &lt;\/c:forEach&gt; &lt;\/ul&gt;  &lt;ul id=&quot;shop-cart&quot;&gt;     &lt;c:forEach var=&quot;item&quot; items=&quot;#{storage.shoppingCart.items}&quot;&gt;         &lt;li data-article=&quot;${item.article.id}&quot;&gt;${item.article.name}             &lt;c:forEach var=&quot;topping&quot; items=&quot;${item.toppings}&quot;&gt;                 &lt;span data-topping=&quot;${topping.id}&quot;&gt;${topping.name}&lt;\/span&gt;             &lt;\/c:forEach&gt;             &lt;input name=&quot;quantity&quot; type=&quot;number&quot; value=&quot;${item.quantity}&quot; min=&quot;1&quot;\/&gt;         &lt;\/li&gt;     &lt;\/c:forEach&gt; &lt;\/ul&gt; <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u043f\u043e\u043a\u0443\u043f\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 MVVM \u043f\u043e\u0434\u0445\u043e\u0434 \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435. \u0412 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0438 \u0441 REST \u0441\u043b\u0443\u0436\u0431\u043e\u0439, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0439 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c XML \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c \u0441\u043b\u0443\u0436\u0431\u0430\u043c).<\/p>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0442\u0430\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u0434\u043b\u044f \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0435\u0440\u0435\u0432\u043e\u043c; \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 (\u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043b\u0438\u0431\u043e \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043b\u043e\u0445\u043e \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u201c\u0434\u0440\u0435\u0432\u0435\u0441\u043d\u0443\u044e\u201d \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 HTML) \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 SVG \u0438\u043b\u0438 \u0445\u043e\u043b\u0441\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a) \u0438\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0438\u043d\u043e\u0435 \u043a\u0430\u043a Flash \u0438\u043b\u0438 JavaFX.    \t \t\t   \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\/company\/etnasoft\/blog\/169577\/\"> http:\/\/habrahabr.ru\/company\/etnasoft\/blog\/169577\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041a\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c JavaScript \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0438\u0445 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440, \u0438 \u0432\u0441\u0435 \u0441\u043f\u043e\u0440\u044b \u0432\u0435\u0434\u0443\u0442\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0432\u0438\u0434\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430. \u041d\u0430\u0448 \u0432\u044b\u0431\u043e\u0440 \u043f\u0440\u043e\u0441\u0442\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e HTML (\u0441 \u0445\u043e\u043b\u0441\u0442\u043e\u043c \u0438\u043b\u0438 \u0431\u0435\u0437) \u0434\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e SVG \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Flash \u043f\u043b\u0435\u0435\u0440\u0430.<\/p>\n<p>  \u0412\u044b\u0431\u0440\u0430\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u044d\u0442\u0438\u043c\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438 \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e: SVG \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u0434\u043b\u044f \u0441\u0445\u0435\u043c \u0438\u043b\u0438 \u043f\u043b\u0430\u043d\u043e\u0432 \u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0435\u043a\u0442\u043e\u0440\u043d\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u043a\u0438, \u0445\u043e\u043b\u0441\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u0444\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0439 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u041e\u0434\u043d\u0430\u043a\u043e, \u043e\u0431\u0430 \u044d\u0442\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u00ab\u043e\u0442\u0434\u0435\u043b\u0435\u043d\u0438\u044f\u00bb \u0441\u0435\u0431\u044f \u043e\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u041f\u043e\u0434 \u00ab\u043e\u0442\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c\u00bb \u044f \u0438\u043c\u0435\u044e \u0432\u0432\u0438\u0434\u0443 \u0442\u043e, \u0447\u0442\u043e \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 \u044d\u0442\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u0434\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0438\u0434\u0430 \u0441 \u043c\u043e\u0434\u0435\u043b\u044c\u044e.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u0440\u0435\u0432\u043e\u043c \u0438\u043b\u0438 \u0441\u043f\u0438\u0441\u043a\u043e\u043c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0440\u0437\u0438\u043d\u0430 \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044f \u0438\u043b\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441), \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 HTML \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0433\u043b\u043e \u0431\u044b \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443.  <\/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-169577","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/169577","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=169577"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/169577\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=169577"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=169577"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=169577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}