{"id":9248,"date":"2026-09-24T09:00:00","date_gmt":"2026-09-24T09:00:00","guid":{"rendered":"https:\/\/otus.ru\/journal\/?p=9248"},"modified":"2026-09-25T15:25:20","modified_gmt":"2026-09-25T15:25:20","slug":"ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov","status":"publish","type":"post","link":"https:\/\/otus.ru\/journal\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\/","title":{"rendered":"jQuery AJAX: \u0437\u0430\u043f\u0440\u043e\u0441\u044b $.ajax, $.get, $.post \u0438 \u0438\u0445 \u0430\u043d\u0430\u043b\u043e\u0433 \u043d\u0430 fetch"},"content":{"rendered":"<p><strong>jQuery AJAX<\/strong> &#8212; \u044d\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 jQuery \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u0437 JavaScript \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b: \u0431\u0430\u0437\u043e\u0432\u0430\u044f <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.ajax()<\/code> \u0438 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.get()<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.post()<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.getJSON()<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.load()<\/code>. \u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0447\u0435\u0440\u0435\u0437 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043e\u0431\u044a\u0435\u043a\u0442 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">XMLHttpRequest<\/code> \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">jqXHR<\/code>, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0448\u0430\u044e\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.done()<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.fail()<\/code> \u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.always()<\/code>.<\/p>\n<div class=\"oj-toc\" style=\"background:#f6f6f6;border-radius:8px;padding:14px 20px;margin:20px 0\">\n<p><strong>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/strong><\/p>\n<ol>\n<li><a href=\"#s1\">\u0427\u0442\u043e \u0435\u0441\u0442\u044c \u0447\u0442\u043e: AJAX, XHR, jqXHR, fetch<\/a><\/li>\n<li><a href=\"#s2\">\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440<\/a><\/li>\n<li><a href=\"#s3\">\u0420\u0430\u0437\u0431\u043e\u0440 $.ajax: \u0433\u043b\u0430\u0432\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/a><\/li>\n<li><a href=\"#s4\">\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438: .done, .fail, .always \u0438 .then<\/a><\/li>\n<li><a href=\"#s5\">\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f: $.get, $.post, $.getJSON, .load<\/a><\/li>\n<li><a href=\"#s6\">\u0422\u0438\u043f\u0438\u0447\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430: JSON \u0443\u0445\u043e\u0434\u0438\u0442 \u043a\u0430\u043a \u0444\u043e\u0440\u043c\u0430<\/a><\/li>\n<li><a href=\"#s7\">\u0422\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 \u043d\u0430 fetch<\/a><\/li>\n<li><a href=\"#s8\">\u0415\u0441\u043b\u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c<\/a><\/li>\n<li><a href=\"#s9\">\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/a><\/li>\n<li><a href=\"#s10\">\u0412\u044b\u0432\u043e\u0434\u044b<\/a><\/li>\n<li><a href=\"#s11\">\u0413\u0434\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \/ \u0441\u0432\u044f\u0437\u044c \u0441 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439<\/a><\/li>\n<li><a href=\"#s12\">FAQ<\/a><\/li>\n<\/ol>\n<\/div>\n<p>jQuery \u043d\u0430 2026 \u0433\u043e\u0434 &#8212; \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u0434\u0430: \u0432 \u043d\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0442\u043e\u0442 \u0436\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0438\u0448\u0443\u0442 \u043d\u0430 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u043c <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">fetch<\/code>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0438\u0436\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u0438\u0435\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u0432 \u0434\u0432\u0443\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u044b \u043d\u0430 jQuery 4.0.0 \u0438 Node.js 24 (\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044c 2026).<\/p>\n<h2 id=\"s1\">\u0427\u0442\u043e \u0435\u0441\u0442\u044c \u0447\u0442\u043e: AJAX, XHR, jqXHR, fetch<\/h2>\n<p>\u042d\u0442\u0438 \u0441\u043b\u043e\u0432\u0430 \u0447\u0430\u0441\u0442\u043e \u0441\u043c\u0435\u0448\u0438\u0432\u0430\u044e\u0442, \u0445\u043e\u0442\u044f \u043e\u043d\u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u0443\u0440\u043e\u0432\u043d\u0438.<\/p>\n<table>\n<thead>\n<tr>\n<th>\u0422\u0435\u0440\u043c\u0438\u043d<\/th>\n<th>\u0427\u0442\u043e \u044d\u0442\u043e<\/th>\n<th>\u0413\u0434\u0435 \u0436\u0438\u0432\u0435\u0442<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>AJAX<\/td>\n<td>\u041f\u043e\u0434\u0445\u043e\u0434: \u0437\u0430\u043f\u0440\u043e\u0441 \u0438\u0437 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 \u0444\u043e\u043d\u0435 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u041d\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438 \u043d\u0435 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b<\/td>\n<td>\u0418\u0434\u0435\u044f, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441 2005 \u0433\u043e\u0434\u0430<\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">XMLHttpRequest<\/code> (XHR)<\/td>\n<td>\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043d\u044b\u0439 API \u0434\u043b\u044f HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0441\u043e\u0431\u044b\u0442\u0438\u0439\u043d\u044b\u0439<\/td>\n<td>\u0411\u0440\u0430\u0443\u0437\u0435\u0440<\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">jqXHR<\/code><\/td>\n<td>\u041e\u0431\u0435\u0440\u0442\u043a\u0430 jQuery \u043d\u0430\u0434 XHR \u0441 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u043f\u0440\u043e\u043c\u0438\u0441\u0430 (<code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.done<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.fail<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.then<\/code>)<\/td>\n<td>jQuery<\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">fetch<\/code><\/td>\n<td>\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 API \u043d\u0430 \u043f\u0440\u043e\u043c\u0438\u0441\u0430\u0445<\/td>\n<td>\u0411\u0440\u0430\u0443\u0437\u0435\u0440, Node.js 18+<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0411\u0443\u043a\u0432\u0430 X \u0432 AJAX \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 XML, \u043d\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442 JSON. \u0421\u0430\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u043c HTTP: \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0435\u0433\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b jQuery.<\/p>\n<h2 id=\"s2\">\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440<\/h2>\n<p>\u041d\u0443\u0436\u043d\u044b \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430. \u0421\u0435\u0440\u0432\u0435\u0440 \u043d\u0438\u0436\u0435 \u043e\u0442\u0434\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u0443\u0440\u0441\u043e\u0432 \u043f\u043e GET, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c \u043d\u0430 \u043a\u0443\u0440\u0441 \u043f\u043e POST (\u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON) \u0438 \u0440\u0430\u0437\u0434\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u043a\u0443. \u041f\u043e\u043b\u043e\u0436\u0438\u0442\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">jquery.min.js<\/code> \u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">index.html<\/code> \u0432 \u043f\u0430\u043f\u043a\u0443 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">public<\/code> \u0440\u044f\u0434\u043e\u043c \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c.<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\"><span style=\"color: #7F848E\">\/\/ server.js - \u0443\u0447\u0435\u0431\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440: node server.js, \u0437\u0430\u0442\u0435\u043c http:\/\/localhost:3000<\/span>\n<span style=\"color: #C678DD\">const<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">http<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">require<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"node:http\"<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #C678DD\">const<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">fs<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">require<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"node:fs\"<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #C678DD\">const<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">path<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">require<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"node:path\"<\/span><span style=\"color: #ABB2BF\">);<\/span>\n\n<span style=\"color: #C678DD\">const<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">courses<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> [{ <\/span><span style=\"color: #E06C75\">id<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #D19A66\">1<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">title<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"JavaScript Developer. Basic\"<\/span><span style=\"color: #ABB2BF\"> }];<\/span>\n\n<span style=\"color: #C678DD\">function<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">sendJson<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">res<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">status<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">obj<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">  <\/span><span style=\"color: #E06C75\">res<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">writeHead<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">status<\/span><span style=\"color: #ABB2BF\">, { <\/span><span style=\"color: #98C379\">\"Content-Type\"<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"application\/json; charset=utf-8\"<\/span><span style=\"color: #ABB2BF\"> });<\/span>\n<span style=\"color: #ABB2BF\">  <\/span><span style=\"color: #E06C75\">res<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">end<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E5C07B\">JSON<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">stringify<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">obj<\/span><span style=\"color: #ABB2BF\">));<\/span>\n<span style=\"color: #ABB2BF\">}<\/span>\n\n<span style=\"color: #E06C75\">http<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">createServer<\/span><span style=\"color: #ABB2BF\">((<\/span><span style=\"color: #E06C75\">req<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">res<\/span><span style=\"color: #ABB2BF\">) =&gt; {<\/span>\n<span style=\"color: #ABB2BF\">  <\/span><span style=\"color: #C678DD\">if<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">req<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">method<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">===<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"GET\"<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">&amp;&amp;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">req<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">url<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">===<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"\/api\/courses\"<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">return<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">sendJson<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">res<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #D19A66\">200<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">courses<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">  }<\/span>\n<span style=\"color: #ABB2BF\">  <\/span><span style=\"color: #C678DD\">if<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">req<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">url<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">===<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"\/api\/slow\"<\/span><span style=\"color: #ABB2BF\">) { <\/span><span style=\"color: #7F848E\">\/\/ \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0430<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">return<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">setTimeout<\/span><span style=\"color: #ABB2BF\">(() =&gt; <\/span><span style=\"color: #E06C75\">sendJson<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">res<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #D19A66\">200<\/span><span style=\"color: #ABB2BF\">, { <\/span><span style=\"color: #E06C75\">late<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">true<\/span><span style=\"color: #ABB2BF\"> }), <\/span><span style=\"color: #D19A66\">3000<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">  }<\/span>\n<span style=\"color: #ABB2BF\">  <\/span><span style=\"color: #C678DD\">if<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">req<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">method<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">===<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"POST\"<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">&amp;&amp;<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">req<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">url<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">===<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"\/api\/signup\"<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">let<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">body<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"\"<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #E06C75\">req<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">on<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"data\"<\/span><span style=\"color: #ABB2BF\">, (<\/span><span style=\"color: #E06C75\">chunk<\/span><span style=\"color: #ABB2BF\">) =&gt; (<\/span><span style=\"color: #E06C75\">body<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">+=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">chunk<\/span><span style=\"color: #ABB2BF\">));<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">return<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">req<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">on<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"end\"<\/span><span style=\"color: #ABB2BF\">, () =&gt; {<\/span>\n<span style=\"color: #ABB2BF\">      <\/span><span style=\"color: #C678DD\">const<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">type<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">req<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">headers<\/span><span style=\"color: #ABB2BF\">[<\/span><span style=\"color: #98C379\">\"content-type\"<\/span><span style=\"color: #ABB2BF\">] <\/span><span style=\"color: #56B6C2\">||<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"\"<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #ABB2BF\">      <\/span><span style=\"color: #C678DD\">if<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #56B6C2\">!<\/span><span style=\"color: #E06C75\">type<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">startsWith<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"application\/json\"<\/span><span style=\"color: #ABB2BF\">)) {<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #C678DD\">return<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">sendJson<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">res<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #D19A66\">415<\/span><span style=\"color: #ABB2BF\">, { <\/span><span style=\"color: #E06C75\">error<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"\u043e\u0436\u0438\u0434\u0430\u044e JSON\"<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">got<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">type<\/span><span style=\"color: #ABB2BF\"> });<\/span>\n<span style=\"color: #ABB2BF\">      }<\/span>\n<span style=\"color: #ABB2BF\">      <\/span><span style=\"color: #C678DD\">let<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">data<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #ABB2BF\">      <\/span><span style=\"color: #C678DD\">try<\/span><span style=\"color: #ABB2BF\"> { <\/span><span style=\"color: #E06C75\">data<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">JSON<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">parse<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">body<\/span><span style=\"color: #ABB2BF\">); } <\/span><span style=\"color: #C678DD\">catch<\/span><span style=\"color: #ABB2BF\"> { <\/span><span style=\"color: #C678DD\">return<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">sendJson<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">res<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #D19A66\">400<\/span><span style=\"color: #ABB2BF\">, { <\/span><span style=\"color: #E06C75\">error<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"\u0431\u0438\u0442\u044b\u0439 JSON\"<\/span><span style=\"color: #ABB2BF\"> }); }<\/span>\n<span style=\"color: #ABB2BF\">      <\/span><span style=\"color: #C678DD\">if<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #56B6C2\">!<\/span><span style=\"color: #E06C75\">data<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">email<\/span><span style=\"color: #ABB2BF\">) <\/span><span style=\"color: #C678DD\">return<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">sendJson<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">res<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #D19A66\">422<\/span><span style=\"color: #ABB2BF\">, { <\/span><span style=\"color: #E06C75\">error<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"\u043d\u0435\u0442 email\"<\/span><span style=\"color: #ABB2BF\"> });<\/span>\n<span style=\"color: #ABB2BF\">      <\/span><span style=\"color: #E06C75\">sendJson<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">res<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #D19A66\">201<\/span><span style=\"color: #ABB2BF\">, { <\/span><span style=\"color: #E06C75\">ok<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">true<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">email<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">data<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">email<\/span><span style=\"color: #ABB2BF\"> });<\/span>\n<span style=\"color: #ABB2BF\">    });<\/span>\n<span style=\"color: #ABB2BF\">  }<\/span>\n<span style=\"color: #ABB2BF\">  <\/span><span style=\"color: #7F848E\">\/\/ \u0441\u0442\u0430\u0442\u0438\u043a\u0430: index.html \u0438 jquery.min.js \u0438\u0437 \u043f\u0430\u043f\u043a\u0438 public<\/span>\n<span style=\"color: #ABB2BF\">  <\/span><span style=\"color: #C678DD\">const<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">file<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">req<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">url<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">===<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"\/\"<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">?<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"index.html\"<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">path<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">basename<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">req<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">url<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">  <\/span><span style=\"color: #E06C75\">fs<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">readFile<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">path<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">join<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">__dirname<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #98C379\">\"public\"<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">file<\/span><span style=\"color: #ABB2BF\">), (<\/span><span style=\"color: #E06C75\">err<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">content<\/span><span style=\"color: #ABB2BF\">) =&gt; {<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">if<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">err<\/span><span style=\"color: #ABB2BF\">) <\/span><span style=\"color: #C678DD\">return<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">sendJson<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">res<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #D19A66\">404<\/span><span style=\"color: #ABB2BF\">, { <\/span><span style=\"color: #E06C75\">error<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"not found\"<\/span><span style=\"color: #ABB2BF\"> });<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">const<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">type<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">file<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">endsWith<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\".js\"<\/span><span style=\"color: #ABB2BF\">) <\/span><span style=\"color: #56B6C2\">?<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"text\/javascript\"<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"text\/html; charset=utf-8\"<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #E06C75\">res<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">writeHead<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #D19A66\">200<\/span><span style=\"color: #ABB2BF\">, { <\/span><span style=\"color: #98C379\">\"Content-Type\"<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">type<\/span><span style=\"color: #ABB2BF\"> });<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #E06C75\">res<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">end<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">content<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">  });<\/span>\n<span style=\"color: #ABB2BF\">}).<\/span><span style=\"color: #E06C75\">listen<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #D19A66\">3000<\/span><span style=\"color: #ABB2BF\">, () =&gt; <\/span><span style=\"color: #E06C75\">console<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">log<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"http:\/\/localhost:3000\"<\/span><span style=\"color: #ABB2BF\">));<\/span><\/code><\/pre>\n<p>\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0434\u0435\u043b\u0430\u0435\u0442 \u0434\u0432\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430: GET \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0438 POST \u043f\u0440\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0435 \u0444\u043e\u0440\u043c\u044b.<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\"><span style=\"color: #7F848E\">&lt;!doctype html&gt;<\/span>\n<span style=\"color: #ABB2BF\">&lt;<\/span><span style=\"color: #E06C75\">html<\/span> <span style=\"color: #E06C75\">lang<\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #98C379\">\"ru\"<\/span><span style=\"color: #ABB2BF\">&gt;<\/span>\n<span style=\"color: #ABB2BF\">&lt;<\/span><span style=\"color: #E06C75\">head<\/span><span style=\"color: #ABB2BF\">&gt;&lt;<\/span><span style=\"color: #E06C75\">meta<\/span> <span style=\"color: #E06C75\">charset<\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #98C379\">\"utf-8\"<\/span><span style=\"color: #ABB2BF\">&gt;&lt;<\/span><span style=\"color: #E06C75\">title<\/span><span style=\"color: #ABB2BF\">&gt;<\/span>jQuery AJAX<span style=\"color: #ABB2BF\">&lt;\/<\/span><span style=\"color: #E06C75\">title<\/span><span style=\"color: #ABB2BF\">&gt;&lt;\/<\/span><span style=\"color: #E06C75\">head<\/span><span style=\"color: #ABB2BF\">&gt;<\/span>\n<span style=\"color: #ABB2BF\">&lt;<\/span><span style=\"color: #E06C75\">body<\/span><span style=\"color: #ABB2BF\">&gt;<\/span>\n  <span style=\"color: #ABB2BF\">&lt;<\/span><span style=\"color: #E06C75\">ul<\/span> <span style=\"color: #E06C75\">id<\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #98C379\">\"courses\"<\/span><span style=\"color: #ABB2BF\">&gt;&lt;\/<\/span><span style=\"color: #E06C75\">ul<\/span><span style=\"color: #ABB2BF\">&gt;<\/span>\n  <span style=\"color: #ABB2BF\">&lt;<\/span><span style=\"color: #E06C75\">form<\/span> <span style=\"color: #E06C75\">id<\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #98C379\">\"signup\"<\/span><span style=\"color: #ABB2BF\">&gt;<\/span>\n    <span style=\"color: #ABB2BF\">&lt;<\/span><span style=\"color: #E06C75\">input<\/span> <span style=\"color: #E06C75\">name<\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #98C379\">\"email\"<\/span> <span style=\"color: #E06C75\">value<\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #98C379\">\"student@example.com\"<\/span><span style=\"color: #ABB2BF\">&gt;<\/span>\n    <span style=\"color: #ABB2BF\">&lt;<\/span><span style=\"color: #E06C75\">button<\/span><span style=\"color: #ABB2BF\">&gt;<\/span>\u0417\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f<span style=\"color: #ABB2BF\">&lt;\/<\/span><span style=\"color: #E06C75\">button<\/span><span style=\"color: #ABB2BF\">&gt;<\/span>\n  <span style=\"color: #ABB2BF\">&lt;\/<\/span><span style=\"color: #E06C75\">form<\/span><span style=\"color: #ABB2BF\">&gt;<\/span>\n  <span style=\"color: #ABB2BF\">&lt;<\/span><span style=\"color: #E06C75\">p<\/span> <span style=\"color: #E06C75\">id<\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #98C379\">\"status\"<\/span><span style=\"color: #ABB2BF\">&gt;&lt;\/<\/span><span style=\"color: #E06C75\">p<\/span><span style=\"color: #ABB2BF\">&gt;<\/span>\n\n  <span style=\"color: #ABB2BF\">&lt;<\/span><span style=\"color: #E06C75\">script<\/span> <span style=\"color: #E06C75\">src<\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #98C379\">\"\/jquery.min.js\"<\/span><span style=\"color: #ABB2BF\">&gt;&lt;\/<\/span><span style=\"color: #E06C75\">script<\/span><span style=\"color: #ABB2BF\">&gt;<\/span>\n  <span style=\"color: #ABB2BF\">&lt;<\/span><span style=\"color: #E06C75\">script<\/span><span style=\"color: #ABB2BF\">&gt;<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #7F848E\">\/\/ 1. GET: \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c JSON \u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u043f\u0438\u0441\u043e\u043a<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #E06C75\">$<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">ajax<\/span><span style=\"color: #ABB2BF\">({ <\/span><span style=\"color: #E06C75\">url<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"\/api\/courses\"<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">method<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"GET\"<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">dataType<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"json\"<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">timeout<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #D19A66\">5000<\/span><span style=\"color: #ABB2BF\"> })<\/span>\n<span style=\"color: #ABB2BF\">      .<\/span><span style=\"color: #E06C75\">done<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #C678DD\">function<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">courses<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">courses<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">forEach<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #C678DD\">function<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">c<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">          <\/span><span style=\"color: #E06C75\">$<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"&lt;li&gt;\"<\/span><span style=\"color: #ABB2BF\">).<\/span><span style=\"color: #E06C75\">text<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">c<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">title<\/span><span style=\"color: #ABB2BF\">).<\/span><span style=\"color: #E06C75\">appendTo<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"#courses\"<\/span><span style=\"color: #ABB2BF\">); <\/span><span style=\"color: #7F848E\">\/\/ .text(), \u043d\u0435 .html()<\/span>\n<span style=\"color: #ABB2BF\">        });<\/span>\n<span style=\"color: #ABB2BF\">      })<\/span>\n<span style=\"color: #ABB2BF\">      .<\/span><span style=\"color: #E06C75\">fail<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #C678DD\">function<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">jqXHR<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">textStatus<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">$<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"#status\"<\/span><span style=\"color: #ABB2BF\">).<\/span><span style=\"color: #E06C75\">text<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438: \"<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">textStatus<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\" \"<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">jqXHR<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">status<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">      });<\/span>\n\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #7F848E\">\/\/ 2. POST: \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0443 \u043a\u0430\u043a JSON \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #E06C75\">$<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"#signup\"<\/span><span style=\"color: #ABB2BF\">).<\/span><span style=\"color: #E06C75\">on<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"submit\"<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #C678DD\">function<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">event<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">      <\/span><span style=\"color: #E06C75\">event<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">preventDefault<\/span><span style=\"color: #ABB2BF\">();<\/span>\n<span style=\"color: #ABB2BF\">      <\/span><span style=\"color: #E06C75\">$<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">ajax<\/span><span style=\"color: #ABB2BF\">({<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">url<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"\/api\/signup\"<\/span><span style=\"color: #ABB2BF\">,<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">method<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"POST\"<\/span><span style=\"color: #ABB2BF\">,<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">contentType<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"application\/json\"<\/span><span style=\"color: #ABB2BF\">,<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">data<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">JSON<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">stringify<\/span><span style=\"color: #ABB2BF\">({ <\/span><span style=\"color: #E06C75\">email<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">$<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #C678DD\">this<\/span><span style=\"color: #ABB2BF\">).<\/span><span style=\"color: #E06C75\">find<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"[name=email]\"<\/span><span style=\"color: #ABB2BF\">).<\/span><span style=\"color: #E06C75\">val<\/span><span style=\"color: #ABB2BF\">() }),<\/span>\n<span style=\"color: #ABB2BF\">        <\/span><span style=\"color: #E06C75\">dataType<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"json\"<\/span>\n<span style=\"color: #ABB2BF\">      })<\/span>\n<span style=\"color: #ABB2BF\">        .<\/span><span style=\"color: #E06C75\">done<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #C678DD\">function<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">data<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">textStatus<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">jqXHR<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">          <\/span><span style=\"color: #E06C75\">$<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"#status\"<\/span><span style=\"color: #ABB2BF\">).<\/span><span style=\"color: #E06C75\">text<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">jqXHR<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">status<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\": \u0437\u0430\u043f\u0438\u0441\u0430\u043d \"<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">data<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">email<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">        })<\/span>\n<span style=\"color: #ABB2BF\">        .<\/span><span style=\"color: #E06C75\">fail<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #C678DD\">function<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">jqXHR<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">          <\/span><span style=\"color: #E06C75\">$<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"#status\"<\/span><span style=\"color: #ABB2BF\">).<\/span><span style=\"color: #E06C75\">text<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">jqXHR<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">status<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\": \"<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">jqXHR<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">responseJSON<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">?<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">jqXHR<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">responseJSON<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">error<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">jqXHR<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">statusText<\/span><span style=\"color: #ABB2BF\">));<\/span>\n<span style=\"color: #ABB2BF\">        })<\/span>\n<span style=\"color: #ABB2BF\">        .<\/span><span style=\"color: #E06C75\">always<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #C678DD\">function<\/span><span style=\"color: #ABB2BF\"> () {<\/span>\n<span style=\"color: #ABB2BF\">          <\/span><span style=\"color: #E06C75\">console<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">log<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"\u0437\u0430\u043f\u0440\u043e\u0441 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\"<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">        });<\/span>\n<span style=\"color: #ABB2BF\">    });<\/span>\n<span style=\"color: #ABB2BF\">  &lt;\/<\/span><span style=\"color: #E06C75\">script<\/span><span style=\"color: #ABB2BF\">&gt;<\/span>\n<span style=\"color: #ABB2BF\">&lt;\/<\/span><span style=\"color: #E06C75\">body<\/span><span style=\"color: #ABB2BF\">&gt;<\/span>\n<span style=\"color: #ABB2BF\">&lt;\/<\/span><span style=\"color: #E06C75\">html<\/span><span style=\"color: #ABB2BF\">&gt;<\/span><\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">node server.js<\/code> \u0438 \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">http:\/\/localhost:3000<\/code>. \u0412 \u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u00abJavaScript Developer. Basic\u00bb. \u041f\u043e\u0441\u043b\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u0432 \u0430\u0431\u0437\u0430\u0446\u0435 \u0431\u0443\u0434\u0435\u0442 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">201: \u0437\u0430\u043f\u0438\u0441\u0430\u043d student@example.com<\/code>, \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 &#8212; \u00ab\u0437\u0430\u043f\u0440\u043e\u0441 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u00bb. \u0415\u0441\u043b\u0438 \u0441\u0442\u0435\u0440\u0435\u0442\u044c email \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u043d\u043e\u0432\u0430, \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.fail<\/code>: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">422: \u043d\u0435\u0442 email<\/code>. \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">index.html<\/code> \u0434\u0432\u043e\u0439\u043d\u044b\u043c \u043a\u043b\u0438\u043a\u043e\u043c (\u0430\u0434\u0440\u0435\u0441 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">file:\/\/<\/code>) \u043d\u0435\u043b\u044c\u0437\u044f: \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">\/api\/...<\/code> \u0443\u0439\u0434\u0443\u0442 \u043d\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440, \u0438 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<h2 id=\"s3\">\u0420\u0430\u0437\u0431\u043e\u0440 $.ajax: \u0433\u043b\u0430\u0432\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/h2>\n<p><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.ajax()<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 jQuery \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 &#8212; \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0442\u043e\u0439 \u0436\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.ajax()<\/code>.<\/p>\n<table>\n<thead>\n<tr>\n<th>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440<\/th>\n<th>\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442<\/th>\n<th>\u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">url<\/code><\/td>\n<td>\u0410\u0434\u0440\u0435\u0441 \u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">\"\/api\/courses\"<\/code><\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">method<\/code><\/td>\n<td>HTTP-\u043c\u0435\u0442\u043e\u0434 (\u0441\u0442\u0430\u0440\u043e\u0435 \u0438\u043c\u044f &#8212; <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">type<\/code>, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u0441\u0438\u043d\u043e\u043d\u0438\u043c)<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">\"POST\"<\/code><\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">data<\/code><\/td>\n<td>\u0414\u0430\u043d\u043d\u044b\u0435: \u043e\u0431\u044a\u0435\u043a\u0442 \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0444\u043e\u0440\u043c\u0430 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">a=1&amp;b=2<\/code>, \u0441\u0442\u0440\u043e\u043a\u0430 \u0443\u0445\u043e\u0434\u0438\u0442 \u043a\u0430\u043a \u0435\u0441\u0442\u044c<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">JSON.stringify(...)<\/code><\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">contentType<\/code><\/td>\n<td>\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Content-Type<\/code> \u0442\u0435\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e &#8212; \u0444\u043e\u0440\u043c\u0430<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">\"application\/json\"<\/code><\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">dataType<\/code><\/td>\n<td>\u041a\u0430\u043a \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">json<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">text<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">html<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">script<\/code><\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">\"json\"<\/code><\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">timeout<\/code><\/td>\n<td>\u0421\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434 \u0436\u0434\u0430\u0442\u044c \u0434\u043e \u043e\u0448\u0438\u0431\u043a\u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">timeout<\/code><\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">5000<\/code><\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">headers<\/code><\/td>\n<td>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 CSRF-\u0442\u043e\u043a\u0435\u043d<\/td>\n<td>&#8212;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0412\u0430\u0436\u043d\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">contentType<\/code> \u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">dataType<\/code>: \u043f\u0435\u0440\u0432\u044b\u0439 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0442\u043e, \u0447\u0442\u043e \u0432\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0435, \u0432\u0442\u043e\u0440\u043e\u0439 &#8212; \u043a\u0430\u043a jQuery \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u0442 \u043e\u0442\u0432\u0435\u0442.<\/p>\n<h2 id=\"s4\">\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438: .done, .fail, .always \u0438 .then<\/h2>\n<p><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.done(data, textStatus, jqXHR)<\/code> \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u0438 \u043a\u043e\u0434\u0435 2xx \u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u0440\u0430\u0437\u0431\u043e\u0440\u0435 \u043e\u0442\u0432\u0435\u0442\u0430. <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.fail(jqXHR, textStatus, errorThrown)<\/code> &#8212; \u043f\u0440\u0438 \u043a\u043e\u0434\u0435 4xx\/5xx, \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0435, \u043e\u0431\u0440\u044b\u0432\u0435 \u0441\u0435\u0442\u0438 \u0438 \u043e\u0448\u0438\u0431\u043a\u0435 \u0440\u0430\u0437\u0431\u043e\u0440\u0430. <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.always<\/code> &#8212; \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435. <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">jqXHR<\/code> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.then()<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u043f\u0440\u043e\u043c\u0438\u0441\u043e\u0432 \u0442\u043e\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.getJSON(\"\/api\/courses\").then(d =&gt; d.length)<\/code> \u0432\u0435\u0440\u043d\u0435\u0442 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">1<\/code>.<\/p>\n<p>\u041e\u043f\u0446\u0438\u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">success<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">error<\/code> \u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">complete<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f. \u0410 \u0432\u043e\u0442 \u043e\u0434\u043d\u043e\u0438\u043c\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0443\u0431\u0440\u0430\u043b\u0438 \u0432 jQuery 3.0, \u0438 \u0441\u0442\u0430\u0440\u044b\u0439 \u043a\u043e\u0434 \u043f\u0430\u0434\u0430\u0435\u0442 \u043d\u0430 4.0.0 \u0442\u0430\u043a:<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\">TypeError: $.ajax(...).success is not a function\n<\/code><\/pre>\n<p>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 &#8212; \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.success()<\/code> \u043d\u0430 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.done()<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.error()<\/code> \u043d\u0430 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.fail()<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.complete()<\/code> \u043d\u0430 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.always()<\/code>.<\/p>\n<h2 id=\"s5\">\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f: $.get, $.post, $.getJSON, .load<\/h2>\n<table>\n<thead>\n<tr>\n<th>\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435<\/th>\n<th>\u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442<\/th>\n<th>\u042d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442 \u0447\u0435\u0440\u0435\u0437 $.ajax<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.get(url, data)<\/code><\/td>\n<td>GET, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">method: \"GET\"<\/code><\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.post(url, data)<\/code><\/td>\n<td>POST, \u0442\u0435\u043b\u043e \u043a\u0430\u043a \u0444\u043e\u0440\u043c\u0430<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">method: \"POST\"<\/code><\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.getJSON(url)<\/code><\/td>\n<td>GET \u0441 \u0440\u0430\u0437\u0431\u043e\u0440\u043e\u043c JSON<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">dataType: \"json\"<\/code><\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$(\"#box\").load(url)<\/code><\/td>\n<td>GET \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0430 HTML \u043e\u0442\u0432\u0435\u0442\u0430 \u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442; \u0435\u0441\u043b\u0438 \u0432\u0442\u043e\u0440\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u043e\u0431\u044a\u0435\u043a\u0442, \u0443\u0445\u043e\u0434\u0438\u0442 POST<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">dataType: \"html\"<\/code> + <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.html()<\/code><\/td>\n<\/tr>\n<tr>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.getScript(url)<\/code><\/td>\n<td>\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 JS<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">dataType: \"script\"<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0443\u0434\u043e\u0431\u043d\u044b, \u043f\u043e\u043a\u0430 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u0439. \u0412 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.post(url, data, success, dataType)<\/code> \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">contentType<\/code> \u043d\u0435\u0442, \u0438 \u044d\u0442\u043e \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0438\u0436\u0435. \u041e\u0431\u044a\u0435\u043a\u0442\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.post({ url, data, contentType: \"application\/json\" })<\/code> \u0435\u0433\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442, \u043d\u043e \u044d\u0442\u043e \u0443\u0436\u0435 \u0442\u043e\u0442 \u0436\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.ajax<\/code> \u0441 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">method: \"POST\"<\/code>.<\/p>\n<h2 id=\"s6\">\u0422\u0438\u043f\u0438\u0447\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430: JSON \u0443\u0445\u043e\u0434\u0438\u0442 \u043a\u0430\u043a \u0444\u043e\u0440\u043c\u0430<\/h2>\n<p>\u041d\u0435\u0432\u0435\u0440\u043d\u043e: \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u043b\u0438 JSON-\u0441\u0442\u0440\u043e\u043a\u0443 \u0431\u0435\u0437 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">contentType<\/code>.<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\"><span style=\"color: #E06C75\">$<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">post<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"\/api\/signup\"<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E5C07B\">JSON<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">stringify<\/span><span style=\"color: #ABB2BF\">({ <\/span><span style=\"color: #E06C75\">email<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"b@example.com\"<\/span><span style=\"color: #ABB2BF\"> }), <\/span><span style=\"color: #E5C07B\">null<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #98C379\">\"json\"<\/span><span style=\"color: #ABB2BF\">)<\/span>\n<span style=\"color: #ABB2BF\">  .<\/span><span style=\"color: #E06C75\">fail<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #C678DD\">function<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">jqXHR<\/span><span style=\"color: #ABB2BF\">) { <\/span><span style=\"color: #E06C75\">console<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">log<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">jqXHR<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">status<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">jqXHR<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">responseText<\/span><span style=\"color: #ABB2BF\">); });<\/span><\/code><\/pre>\n<p>\u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435:<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\">415 {&quot;error&quot;:&quot;\u043e\u0436\u0438\u0434\u0430\u044e JSON&quot;,&quot;got&quot;:&quot;application\/x-www-form-urlencoded; charset=UTF-8&quot;}\n<\/code><\/pre>\n<p>\u0422\u0435\u043b\u043e \u0443\u0448\u043b\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0439 JSON, \u043d\u043e \u0441 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c \u0444\u043e\u0440\u043c\u044b, \u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u0435\u0433\u043e \u043e\u0442\u0432\u0435\u0440\u0433. \u0415\u0441\u043b\u0438 \u0431\u044b \u0432 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">data<\/code> \u0431\u044b\u043b \u043e\u0431\u044a\u0435\u043a\u0442, jQuery \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043b \u0431\u044b \u0435\u0433\u043e \u043a\u0430\u043a <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">email=b%40example.com<\/code> &#8212; \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0431\u044b \u0442\u043e\u0442 \u0436\u0435 415. \u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 &#8212; <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.ajax<\/code> (\u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0430 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.post<\/code>) \u0441 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">contentType: \"application\/json\"<\/code> \u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">JSON.stringify<\/code>, \u043a\u0430\u043a \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435: \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">201<\/code>.<\/p>\n<h2 id=\"s7\">\u0422\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 \u043d\u0430 fetch<\/h2>\n<p><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">fetch<\/code> \u0432\u0441\u0442\u0440\u043e\u0435\u043d \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u0438 \u0432 Node.js 18+, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0435 \u043d\u0443\u0436\u043d\u0430. \u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435: \u043f\u0440\u043e\u043c\u0438\u0441 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">fetch<\/code> \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435 \u0438\u043b\u0438 \u043e\u0442\u043c\u0435\u043d\u0435. \u041e\u0442\u0432\u0435\u0442 404 \u0438\u043b\u0438 422 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 \u0441\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">response.ok<\/code>.<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\"><span style=\"color: #7F848E\">\/\/ fetch-demo.mjs - \u0442\u0435 \u0436\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 fetch (Node 18+ \u0438\u043b\u0438 \u0431\u0440\u0430\u0443\u0437\u0435\u0440)<\/span>\n<span style=\"color: #C678DD\">const<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">base<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"http:\/\/localhost:3000\"<\/span><span style=\"color: #ABB2BF\">; <\/span><span style=\"color: #7F848E\">\/\/ \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043d\u0430 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 - \u043f\u0440\u043e\u0441\u0442\u043e \"\"<\/span>\n\n<span style=\"color: #C678DD\">async<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">function<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">getJson<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">url<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">options<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> {}) {<\/span>\n<span style=\"color: #ABB2BF\">  <\/span><span style=\"color: #C678DD\">const<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">response<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">await<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">fetch<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">base<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">+<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">url<\/span><span style=\"color: #ABB2BF\">, {<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #E06C75\">signal<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">AbortSignal<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">timeout<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #D19A66\">2000<\/span><span style=\"color: #ABB2BF\">), <\/span><span style=\"color: #7F848E\">\/\/ \u0430\u043d\u0430\u043b\u043e\u0433 timeout: 2000 \u0432 $.ajax<\/span>\n<span style=\"color: #ABB2BF\">    ...<\/span><span style=\"color: #E06C75\">options<\/span><span style=\"color: #ABB2BF\">,<\/span>\n<span style=\"color: #ABB2BF\">  });<\/span>\n<span style=\"color: #ABB2BF\">  <\/span><span style=\"color: #C678DD\">const<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">data<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">await<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">response<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">json<\/span><span style=\"color: #ABB2BF\">().<\/span><span style=\"color: #C678DD\">catch<\/span><span style=\"color: #ABB2BF\">(() =&gt; <\/span><span style=\"color: #E5C07B\">null<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">  <\/span><span style=\"color: #C678DD\">if<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #56B6C2\">!<\/span><span style=\"color: #E06C75\">response<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">ok<\/span><span style=\"color: #ABB2BF\">) { <\/span><span style=\"color: #7F848E\">\/\/ fetch \u041d\u0415 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u0442 \u043f\u0440\u043e\u043c\u0438\u0441 \u043d\u0430 4xx\/5xx<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">throw<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">new<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">Error<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">`${<\/span><span style=\"color: #E06C75\">response<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">status<\/span><span style=\"color: #98C379\">}: ${<\/span><span style=\"color: #E06C75\">data<\/span><span style=\"color: #56B6C2\">?<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">error<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">??<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">response<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">statusText<\/span><span style=\"color: #98C379\">}`<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">  }<\/span>\n<span style=\"color: #ABB2BF\">  <\/span><span style=\"color: #C678DD\">return<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">data<\/span><span style=\"color: #ABB2BF\">;<\/span>\n<span style=\"color: #ABB2BF\">}<\/span>\n\n<span style=\"color: #C678DD\">const<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">courses<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">await<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">getJson<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"\/api\/courses\"<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #E06C75\">console<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">log<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"GET:\"<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">courses<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">map<\/span><span style=\"color: #ABB2BF\">((<\/span><span style=\"color: #E06C75\">c<\/span><span style=\"color: #ABB2BF\">) =&gt; <\/span><span style=\"color: #E06C75\">c<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">title<\/span><span style=\"color: #ABB2BF\">));<\/span>\n\n<span style=\"color: #C678DD\">const<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">created<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #56B6C2\">=<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #C678DD\">await<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">getJson<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"\/api\/signup\"<\/span><span style=\"color: #ABB2BF\">, {<\/span>\n<span style=\"color: #ABB2BF\">  <\/span><span style=\"color: #E06C75\">method<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"POST\"<\/span><span style=\"color: #ABB2BF\">,<\/span>\n<span style=\"color: #ABB2BF\">  <\/span><span style=\"color: #E06C75\">headers<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> { <\/span><span style=\"color: #98C379\">\"Content-Type\"<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"application\/json\"<\/span><span style=\"color: #ABB2BF\"> },<\/span>\n<span style=\"color: #ABB2BF\">  <\/span><span style=\"color: #E06C75\">body<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E5C07B\">JSON<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">stringify<\/span><span style=\"color: #ABB2BF\">({ <\/span><span style=\"color: #E06C75\">email<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"student@example.com\"<\/span><span style=\"color: #ABB2BF\"> }),<\/span>\n<span style=\"color: #ABB2BF\">});<\/span>\n<span style=\"color: #E06C75\">console<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">log<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"POST:\"<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">created<\/span><span style=\"color: #ABB2BF\">);<\/span>\n\n<span style=\"color: #C678DD\">for<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #C678DD\">const<\/span><span style=\"color: #ABB2BF\"> [<\/span><span style=\"color: #E06C75\">url<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">options<\/span><span style=\"color: #ABB2BF\">] <\/span><span style=\"color: #C678DD\">of<\/span><span style=\"color: #ABB2BF\"> [<\/span>\n<span style=\"color: #ABB2BF\">  [<\/span><span style=\"color: #98C379\">\"\/api\/signup\"<\/span><span style=\"color: #ABB2BF\">, { <\/span><span style=\"color: #E06C75\">method<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"POST\"<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">headers<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> { <\/span><span style=\"color: #98C379\">\"Content-Type\"<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"application\/json\"<\/span><span style=\"color: #ABB2BF\"> }, <\/span><span style=\"color: #E06C75\">body<\/span><span style=\"color: #56B6C2\">:<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #98C379\">\"{}\"<\/span><span style=\"color: #ABB2BF\"> }],<\/span>\n<span style=\"color: #ABB2BF\">  [<\/span><span style=\"color: #98C379\">\"\/api\/slow\"<\/span><span style=\"color: #ABB2BF\">, {}],<\/span>\n<span style=\"color: #ABB2BF\">]) {<\/span>\n<span style=\"color: #ABB2BF\">  <\/span><span style=\"color: #C678DD\">try<\/span><span style=\"color: #ABB2BF\"> {<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #C678DD\">await<\/span><span style=\"color: #ABB2BF\"> <\/span><span style=\"color: #E06C75\">getJson<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #E06C75\">url<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">options<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">  } <\/span><span style=\"color: #C678DD\">catch<\/span><span style=\"color: #ABB2BF\"> (<\/span><span style=\"color: #E06C75\">error<\/span><span style=\"color: #ABB2BF\">) {<\/span>\n<span style=\"color: #ABB2BF\">    <\/span><span style=\"color: #E06C75\">console<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">log<\/span><span style=\"color: #ABB2BF\">(<\/span><span style=\"color: #98C379\">\"\u041e\u0448\u0438\u0431\u043a\u0430:\"<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">error<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">name<\/span><span style=\"color: #ABB2BF\">, <\/span><span style=\"color: #E06C75\">error<\/span><span style=\"color: #ABB2BF\">.<\/span><span style=\"color: #E06C75\">message<\/span><span style=\"color: #ABB2BF\">);<\/span>\n<span style=\"color: #ABB2BF\">  }<\/span>\n<span style=\"color: #ABB2BF\">}<\/span><\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">node fetch-demo.mjs<\/code> \u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<pre style=\"background:#282c34;color:#abb2bf;border-radius:8px;padding:16px 20px;margin:20px 0;overflow-x:auto;font-size:14px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\"><code style=\"background:none\">GET: [ &#x27;JavaScript Developer. Basic&#x27; ]\nPOST: { ok: true, email: &#x27;student@example.com&#x27; }\n\u041e\u0448\u0438\u0431\u043a\u0430: Error 422: \u043d\u0435\u0442 email\n\u041e\u0448\u0438\u0431\u043a\u0430: TimeoutError The operation was aborted due to timeout\n<\/code><\/pre>\n<p>\u0411\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">response.ok<\/code> \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 422 \u043f\u0440\u043e\u0448\u0435\u043b \u0431\u044b \u043a\u0430\u043a \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0439: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">fetch<\/code> \u0432\u0435\u0440\u043d\u0443\u043b \u0431\u044b <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">ok: false, status: 422<\/code> \u0431\u0435\u0437 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<\/p>\n<table>\n<thead>\n<tr>\n<th>\u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/th>\n<th>jQuery <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.ajax<\/code><\/th>\n<th><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">fetch<\/code><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u041e\u0442\u0432\u0435\u0442 4xx\/5xx<\/td>\n<td>\u0423\u0445\u043e\u0434\u0438\u0442 \u0432 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.fail<\/code><\/td>\n<td>\u041f\u0440\u043e\u043c\u0438\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">response.ok<\/code><\/td>\n<\/tr>\n<tr>\n<td>\u0420\u0430\u0437\u0431\u043e\u0440 JSON<\/td>\n<td>\u041f\u043e <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">dataType<\/code> \u0438\u043b\u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0443 \u043e\u0442\u0432\u0435\u0442\u0430<\/td>\n<td>\u042f\u0432\u043d\u043e: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">await response.json()<\/code><\/td>\n<\/tr>\n<tr>\n<td>\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 JSON<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">contentType<\/code> + <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">JSON.stringify<\/code><\/td>\n<td>\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a + <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">JSON.stringify<\/code><\/td>\n<\/tr>\n<tr>\n<td>\u0422\u0430\u0439\u043c\u0430\u0443\u0442<\/td>\n<td>\u041e\u043f\u0446\u0438\u044f <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">timeout<\/code>, \u0441\u0442\u0430\u0442\u0443\u0441 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">timeout<\/code><\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">AbortSignal.timeout(ms)<\/code>, \u043e\u0448\u0438\u0431\u043a\u0430 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">TimeoutError<\/code><\/td>\n<\/tr>\n<tr>\n<td>\u041e\u0442\u043c\u0435\u043d\u0430<\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">jqXHR.abort()<\/code><\/td>\n<td><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">AbortController<\/code><\/td>\n<\/tr>\n<tr>\n<td>\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c<\/td>\n<td>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0432 \u043f\u043e\u043b\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0435<\/td>\n<td>\u0412\u0441\u0442\u0440\u043e\u0435\u043d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"s8\">\u0415\u0441\u043b\u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c<\/h2>\n<ul>\n<li><strong><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.ajax is not a function<\/code>.<\/strong> \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0430 slim-\u0441\u0431\u043e\u0440\u043a\u0430 (<code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">jquery.slim.min.js<\/code>), \u0432 \u043d\u0435\u0439 \u043d\u0435\u0442 AJAX, \u0430 \u0432 jQuery 4 &#8212; \u0435\u0449\u0435 \u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.Deferred<\/code>. \u041d\u0443\u0436\u043d\u0430 \u043f\u043e\u043b\u043d\u0430\u044f <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">jquery.min.js<\/code>.<\/li>\n<li><strong><code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.fail<\/code> \u0441 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">parsererror<\/code> \u0438 \u043a\u043e\u0434\u043e\u043c 200.<\/strong> \u0423\u043a\u0430\u0437\u0430\u043d <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">dataType: \"json\"<\/code>, \u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u0435\u0440\u043d\u0443\u043b HTML (\u0447\u0430\u0441\u0442\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\u043b\u0438 \u043b\u043e\u0433\u0438\u043d\u0430). \u0412 V8 \u0442\u0435\u043a\u0441\u0442 \u0442\u0430\u043a\u043e\u0439: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">SyntaxError: Unexpected token '&lt;', \"&lt;!doctype \"... is not valid JSON<\/code>. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043e\u0442\u0432\u0435\u0442 \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 Network.<\/li>\n<li><strong>\u041a\u043e\u0434 0 \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">timeout<\/code> \u0438\u043b\u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">error<\/code>.<\/strong> \u0421\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u043e\u0442\u0432\u0435\u0442\u0438\u043b \u0437\u0430 \u0432\u0440\u0435\u043c\u044f <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">timeout<\/code>, \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043e\u0431\u043e\u0440\u0432\u0430\u043b\u043e\u0441\u044c \u0438\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d. \u0421\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438 Network.<\/li>\n<li><strong>\u041e\u0448\u0438\u0431\u043a\u0430 CORS \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438.<\/strong> \u0417\u0430\u043f\u0440\u043e\u0441 \u0438\u0434\u0435\u0442 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u043e\u043c\u0435\u043d, \u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u043b \u0435\u0433\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">Access-Control-Allow-Origin<\/code>. \u0427\u0438\u043d\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043d\u0435 \u0432 jQuery.<\/li>\n<li><strong>\u0421\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043f\u0443\u0441\u0442\u043e\u0435 \u0442\u0435\u043b\u043e \u0438\u043b\u0438 415.<\/strong> \u041d\u0435 \u0441\u043e\u0432\u043f\u0430\u043b \u0444\u043e\u0440\u043c\u0430\u0442: \u0441\u043c. \u0440\u0430\u0437\u0434\u0435\u043b \u043e <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">contentType<\/code> \u0432\u044b\u0448\u0435.<\/li>\n<\/ul>\n<h2 id=\"s9\">\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/h2>\n<p>\u041e\u0442\u0432\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.text()<\/code>, \u0430 \u043d\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.html()<\/code>: \u0441\u0442\u0440\u043e\u043a\u0430 \u0438\u0437 \u0431\u0430\u0437\u044b, \u0432\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u043a\u0430\u043a HTML, \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0447\u0443\u0436\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 (XSS). \u041f\u043e \u0442\u043e\u0439 \u0436\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.load()<\/code> \u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">dataType: \"script\"<\/code> \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0439\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u0441\u0432\u043e\u0435\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443.<\/p>\n<p>\u0414\u043b\u044f POST-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u0441\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u043c\u0438 cookie \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c CSRF-\u0442\u043e\u043a\u0435\u043d, \u0430 \u043a\u043b\u0438\u0435\u043d\u0442 &#8212; \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0435\u0433\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0447\u0435\u0440\u0435\u0437 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">headers<\/code> \u0438\u043b\u0438 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0432 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.ajaxSetup()<\/code>. CORS &#8212; \u044d\u0442\u043e \u043d\u0435 \u0437\u0430\u0449\u0438\u0442\u0430 API: \u043e\u043d \u043b\u0438\u0448\u044c \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443, \u043a\u0430\u043a\u0438\u043c \u0441\u0430\u0439\u0442\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442, \u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438\u0437 curl \u0438\u043b\u0438 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043e\u043d \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442.<\/p>\n<p>\u0423\u0447\u0435\u0431\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u044b\u0448\u0435 \u043d\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u0442\u0435\u043b\u0430, \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043f\u0440\u0430\u0432\u0430 \u0438 \u043d\u0435 \u043f\u0438\u0448\u0435\u0442 \u0436\u0443\u0440\u043d\u0430\u043b. \u0412 production \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c.<\/p>\n<h2 id=\"s10\">\u0412\u044b\u0432\u043e\u0434\u044b<\/h2>\n<ul>\n<li>jQuery AJAX &#8212; \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">XMLHttpRequest<\/code>: <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.ajax()<\/code> \u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u0430, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.get<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.post<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.getJSON<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.load<\/code> \u043a\u0430\u043a \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f.<\/li>\n<li>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u0447\u0435\u0440\u0435\u0437 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.done<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.fail<\/code>, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.always<\/code> \u0438\u043b\u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.then<\/code>; \u043c\u0435\u0442\u043e\u0434\u044b <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.success()<\/code> \u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.error()<\/code> \u0443\u0434\u0430\u043b\u0435\u043d\u044b \u0432 jQuery 3.0.<\/li>\n<li>\u0427\u0442\u043e\u0431\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c JSON, \u043d\u0443\u0436\u043d\u044b <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">contentType: \"application\/json\"<\/code> \u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">JSON.stringify<\/code>; <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.post<\/code> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0448\u043b\u0435\u0442 \u0444\u043e\u0440\u043c\u0443.<\/li>\n<li>\u0412 \u043d\u043e\u0432\u043e\u043c \u043a\u043e\u0434\u0435 \u0442\u043e\u0442 \u0436\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0438\u0448\u0443\u0442 \u043d\u0430 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">fetch<\/code>, \u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">response.ok<\/code> \u0441\u0430\u043c\u0438: \u043e\u0442\u0432\u0435\u0442 4xx\/5xx \u043f\u0440\u043e\u043c\u0438\u0441 \u043d\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u0442.<\/li>\n<\/ul>\n<h2 id=\"s11\">\u0413\u0434\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \/ \u0441\u0432\u044f\u0437\u044c \u0441 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439<\/h2>\n<p>jQuery AJAX \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u0441\u0430\u0439\u0442\u043e\u0432 \u043d\u0430 CMS, \u0430\u0434\u043c\u0438\u043d\u043a\u0430\u0445 \u0438 \u0441\u0442\u0430\u0440\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430\u0445: \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u043d\u0443\u0436\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434, \u0447\u0438\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0438 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0430 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">fetch<\/code>. \u0427\u0442\u043e \u0443\u043c\u0435\u0435\u0442 \u0441\u0430\u043c\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u043c\u0438\u043c\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"\/journal\/biblioteka-jquery-opisanie-i-oblasti-primeneniya\/\">\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 jQuery: \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/a>.<\/p>\n<div class=\"oj-cta\" style=\"background:#fbf4e4;border-left:4px solid #c9962b;border-radius:8px;padding:16px 20px;margin:24px 0\">\n<p style=\"margin:0 0 8px\"><strong>\u041e\u0441\u0432\u043e\u0439\u0442\u0435 \u0442\u0435\u043c\u0443 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435<\/strong><\/p>\n<p>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 JavaScript, \u043f\u0440\u043e\u043c\u0438\u0441\u044b, <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">async\/await<\/code> \u0438 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0441\u0435\u0442\u044c\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u043d\u0430 \u043a\u0443\u0440\u0441\u0435 <a href=\"https:\/\/otus.ru\/lessons\/javascript-basic\/?int_article=ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov&amp;int_place=article&amp;int_variant=v1\">\u00abJavaScript-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a. \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c\u00bb<\/a>. \u0411\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u043c\u044b \u0441 \u043f\u0440\u0435\u043f\u043e\u0434\u0430\u0432\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430 <a href=\"https:\/\/otus.ru\/events\/?int_article=ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov&amp;int_place=article&amp;int_variant=v1\">\u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0443\u0440\u043e\u043a\u0430\u0445 Otus<\/a>.<\/p>\n<\/div>\n<h2 id=\"s12\">FAQ<\/h2>\n<p><strong>\u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0447\u0435\u0440\u0435\u0437 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">async: false<\/code>?<\/strong><br \/>\n\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043f\u0446\u0438\u044f \u0435\u0441\u0442\u044c, \u043d\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 XHR \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u0441\u0447\u0438\u0442\u0430\u044e\u0442 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u043c: \u043e\u043d \u0437\u0430\u043c\u043e\u0440\u0430\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">.done<\/code> \u0438\u043b\u0438 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">await<\/code>.<\/p>\n<p><strong>\u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u0430?<\/strong><br \/>\n\u0427\u0435\u0440\u0435\u0437 XHR: \u0432 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">$.ajax<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">xhr<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">XMLHttpRequest<\/code> \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">upload.onprogress<\/code>. \u0423 <code style=\"background:#eef0f3;color:#24292f;border-radius:4px;padding:1px 5px;font-size:0.92em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace\">fetch<\/code> \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043d\u0435\u0442.<\/p>\n<p><strong>\u0421\u0442\u043e\u0438\u0442 \u043b\u0438 \u0443\u0431\u0438\u0440\u0430\u0442\u044c jQuery \u0438\u0437 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0440\u0430\u0434\u0438 fetch?<\/strong><br \/>\n\u0422\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u0430: \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0430\u043d\u0434\u043b\u0430, \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0434\u0440\u0443\u0433\u043e\u0433\u043e legacy. \u041f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e &#8212; \u043e\u0431\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>jQuery AJAX &#8212; \u044d\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 jQuery \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u0437 JavaScript \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b: \u0431\u0430\u0437\u043e\u0432\u0430\u044f $.ajax() \u0438 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f $.get(), $.post(), $.getJSON(), .load(). \u041f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0447\u0435\u0440\u0435\u0437 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043e\u0431\u044a\u0435\u043a\u0442 XMLHttpRequest \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 jqXHR, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0448\u0430\u044e\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 .done(), .fail() \u0438 .always(). \u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0427\u0442\u043e \u0435\u0441\u0442\u044c \u0447\u0442\u043e: AJAX, XHR, jqXHR, fetch \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":9249,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[65],"class_list":["post-9248","post","type-post","status-publish","format-standard","has-post-thumbnail","","category-polza","tag-programmirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c jQuery AJAX \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435: $.ajax, $.get, $.post, .done \u0438 .fail, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 JSON, \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 \u043d\u0430 fetch \u0431\u0435\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"A. Pavlenko\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/otus.ru\/journal\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\\\/#article\",\"name\":\"jQuery AJAX: $.ajax, $.get, $.post \\u0438 \\u0430\\u043d\\u0430\\u043b\\u043e\\u0433 \\u043d\\u0430 fetch | Otus\",\"headline\":\"jQuery AJAX: \\u0437\\u0430\\u043f\\u0440\\u043e\\u0441\\u044b $.ajax, $.get, $.post \\u0438 \\u0438\\u0445 \\u0430\\u043d\\u0430\\u043b\\u043e\\u0433 \\u043d\\u0430 fetch\",\"author\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/author\\\/a-pavlenko\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/oj-1080x720-31.jpg\",\"width\":2245,\"height\":1587},\"datePublished\":\"2026-09-24T09:00:00+00:00\",\"dateModified\":\"2026-09-25T15:25:20+00:00\",\"inLanguage\":\"ru-RU\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\\\/#webpage\"},\"articleSection\":\"\\u041f\\u043e\\u043b\\u0435\\u0437\\u043d\\u043e\\u0435, \\u043f\\u0440\\u043e\\u0433\\u0440\\u0430\\u043c\\u043c\\u0438\\u0440\\u043e\\u0432\\u0430\\u043d\\u0438\\u0435\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/otus.ru\\\/journal\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/category\\\/polza\\\/#listItem\",\"name\":\"\\u041f\\u043e\\u043b\\u0435\\u0437\\u043d\\u043e\\u0435\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/category\\\/polza\\\/#listItem\",\"position\":2,\"name\":\"\\u041f\\u043e\\u043b\\u0435\\u0437\\u043d\\u043e\\u0435\",\"item\":\"https:\\\/\\\/otus.ru\\\/journal\\\/category\\\/polza\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\\\/#listItem\",\"name\":\"jQuery AJAX: \\u0437\\u0430\\u043f\\u0440\\u043e\\u0441\\u044b $.ajax, $.get, $.post \\u0438 \\u0438\\u0445 \\u0430\\u043d\\u0430\\u043b\\u043e\\u0433 \\u043d\\u0430 fetch\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\\\/#listItem\",\"position\":3,\"name\":\"jQuery AJAX: \\u0437\\u0430\\u043f\\u0440\\u043e\\u0441\\u044b $.ajax, $.get, $.post \\u0438 \\u0438\\u0445 \\u0430\\u043d\\u0430\\u043b\\u043e\\u0433 \\u043d\\u0430 fetch\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/category\\\/polza\\\/#listItem\",\"name\":\"\\u041f\\u043e\\u043b\\u0435\\u0437\\u043d\\u043e\\u0435\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#organization\",\"name\":\"\\u041e\\u0442\\u0443\\u0441 \\u043e\\u043d\\u043b\\u0430\\u0439\\u043d-\\u043e\\u0431\\u0440\\u0430\\u0437\\u043e\\u0432\\u0430\\u043d\\u0438\\u0435\",\"description\":\"\\u0411\\u043b\\u043e\\u0433 \\u043f\\u0440\\u043e IT\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/\",\"telephone\":\"+74999389202\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/OTUS-journal-logo-180x180-1.png\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\\\/#organizationLogo\",\"width\":180,\"height\":180},\"image\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\\\/#organizationLogo\"},\"sameAs\":[\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCetgtvy93o3i3CvyGXKFU3g\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/author\\\/a-pavlenko\\\/#author\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/author\\\/a-pavlenko\\\/\",\"name\":\"A. Pavlenko\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/13488c7d5b657aaaf1808afd398f71e0225df07dd94eb7e5fcdfc45feff43cb5?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"A. Pavlenko\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\\\/#webpage\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\\\/\",\"name\":\"jQuery AJAX: $.ajax, $.get, $.post \\u0438 \\u0430\\u043d\\u0430\\u043b\\u043e\\u0433 \\u043d\\u0430 fetch | Otus\",\"description\":\"\\u0420\\u0430\\u0437\\u0431\\u0438\\u0440\\u0430\\u0435\\u043c jQuery AJAX \\u043d\\u0430 \\u0440\\u0430\\u0431\\u043e\\u0447\\u0435\\u043c \\u043f\\u0440\\u0438\\u043c\\u0435\\u0440\\u0435: $.ajax, $.get, $.post, .done \\u0438 .fail, \\u043e\\u0442\\u043f\\u0440\\u0430\\u0432\\u043a\\u0430 JSON, \\u0442\\u0438\\u043f\\u0438\\u0447\\u043d\\u044b\\u0435 \\u043e\\u0448\\u0438\\u0431\\u043a\\u0438 \\u0438 \\u0442\\u043e\\u0442 \\u0436\\u0435 \\u043a\\u043e\\u0434 \\u043d\\u0430 fetch \\u0431\\u0435\\u0437 \\u0431\\u0438\\u0431\\u043b\\u0438\\u043e\\u0442\\u0435\\u043a\\u0438.\",\"inLanguage\":\"ru-RU\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/author\\\/a-pavlenko\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/author\\\/a-pavlenko\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/oj-1080x720-31.jpg\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\\\/#mainImage\",\"width\":2245,\"height\":1587},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\\\/#mainImage\"},\"datePublished\":\"2026-09-24T09:00:00+00:00\",\"dateModified\":\"2026-09-25T15:25:20+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#website\",\"url\":\"https:\\\/\\\/otus.ru\\\/journal\\\/\",\"name\":\"OTUS \\u0416\\u0443\\u0440\\u043d\\u0430\\u043b - \\u0411\\u043b\\u043e\\u0433 \\u043f\\u0440\\u043e IT\",\"alternateName\":\"OTUS \\u0416\\u0443\\u0440\\u043d\\u0430\\u043b\",\"description\":\"\\u0411\\u043b\\u043e\\u0433 \\u043f\\u0440\\u043e IT\",\"inLanguage\":\"ru-RU\",\"publisher\":{\"@id\":\"https:\\\/\\\/otus.ru\\\/journal\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"jQuery AJAX: $.ajax, $.get, $.post \u0438 \u0430\u043d\u0430\u043b\u043e\u0433 \u043d\u0430 fetch | Otus","description":"\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c jQuery AJAX \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435: $.ajax, $.get, $.post, .done \u0438 .fail, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 JSON, \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 \u043d\u0430 fetch \u0431\u0435\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.","canonical_url":"https:\/\/otus.ru\/journal\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/otus.ru\/journal\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\/#article","name":"jQuery AJAX: $.ajax, $.get, $.post \u0438 \u0430\u043d\u0430\u043b\u043e\u0433 \u043d\u0430 fetch | Otus","headline":"jQuery AJAX: \u0437\u0430\u043f\u0440\u043e\u0441\u044b $.ajax, $.get, $.post \u0438 \u0438\u0445 \u0430\u043d\u0430\u043b\u043e\u0433 \u043d\u0430 fetch","author":{"@id":"https:\/\/otus.ru\/journal\/author\/a-pavlenko\/#author"},"publisher":{"@id":"https:\/\/otus.ru\/journal\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/otus.ru\/journal\/wp-content\/uploads\/2024\/02\/oj-1080x720-31.jpg","width":2245,"height":1587},"datePublished":"2026-09-24T09:00:00+00:00","dateModified":"2026-09-25T15:25:20+00:00","inLanguage":"ru-RU","mainEntityOfPage":{"@id":"https:\/\/otus.ru\/journal\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\/#webpage"},"isPartOf":{"@id":"https:\/\/otus.ru\/journal\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\/#webpage"},"articleSection":"\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435"},{"@type":"BreadcrumbList","@id":"https:\/\/otus.ru\/journal\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/#listItem","position":1,"name":"Home","item":"https:\/\/otus.ru\/journal\/","nextItem":{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/category\/polza\/#listItem","name":"\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435"}},{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/category\/polza\/#listItem","position":2,"name":"\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435","item":"https:\/\/otus.ru\/journal\/category\/polza\/","nextItem":{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\/#listItem","name":"jQuery AJAX: \u0437\u0430\u043f\u0440\u043e\u0441\u044b $.ajax, $.get, $.post \u0438 \u0438\u0445 \u0430\u043d\u0430\u043b\u043e\u0433 \u043d\u0430 fetch"},"previousItem":{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\/#listItem","position":3,"name":"jQuery AJAX: \u0437\u0430\u043f\u0440\u043e\u0441\u044b $.ajax, $.get, $.post \u0438 \u0438\u0445 \u0430\u043d\u0430\u043b\u043e\u0433 \u043d\u0430 fetch","previousItem":{"@type":"ListItem","@id":"https:\/\/otus.ru\/journal\/category\/polza\/#listItem","name":"\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435"}}]},{"@type":"Organization","@id":"https:\/\/otus.ru\/journal\/#organization","name":"\u041e\u0442\u0443\u0441 \u043e\u043d\u043b\u0430\u0439\u043d-\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435","description":"\u0411\u043b\u043e\u0433 \u043f\u0440\u043e IT","url":"https:\/\/otus.ru\/journal\/","telephone":"+74999389202","logo":{"@type":"ImageObject","url":"https:\/\/otus.ru\/journal\/wp-content\/uploads\/2026\/04\/OTUS-journal-logo-180x180-1.png","@id":"https:\/\/otus.ru\/journal\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\/#organizationLogo","width":180,"height":180},"image":{"@id":"https:\/\/otus.ru\/journal\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\/#organizationLogo"},"sameAs":["https:\/\/www.youtube.com\/channel\/UCetgtvy93o3i3CvyGXKFU3g"]},{"@type":"Person","@id":"https:\/\/otus.ru\/journal\/author\/a-pavlenko\/#author","url":"https:\/\/otus.ru\/journal\/author\/a-pavlenko\/","name":"A. Pavlenko","image":{"@type":"ImageObject","@id":"https:\/\/otus.ru\/journal\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/13488c7d5b657aaaf1808afd398f71e0225df07dd94eb7e5fcdfc45feff43cb5?s=96&d=mm&r=g","width":96,"height":96,"caption":"A. Pavlenko"}},{"@type":"WebPage","@id":"https:\/\/otus.ru\/journal\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\/#webpage","url":"https:\/\/otus.ru\/journal\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\/","name":"jQuery AJAX: $.ajax, $.get, $.post \u0438 \u0430\u043d\u0430\u043b\u043e\u0433 \u043d\u0430 fetch | Otus","description":"\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c jQuery AJAX \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435: $.ajax, $.get, $.post, .done \u0438 .fail, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 JSON, \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 \u043d\u0430 fetch \u0431\u0435\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.","inLanguage":"ru-RU","isPartOf":{"@id":"https:\/\/otus.ru\/journal\/#website"},"breadcrumb":{"@id":"https:\/\/otus.ru\/journal\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\/#breadcrumblist"},"author":{"@id":"https:\/\/otus.ru\/journal\/author\/a-pavlenko\/#author"},"creator":{"@id":"https:\/\/otus.ru\/journal\/author\/a-pavlenko\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/otus.ru\/journal\/wp-content\/uploads\/2024\/02\/oj-1080x720-31.jpg","@id":"https:\/\/otus.ru\/journal\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\/#mainImage","width":2245,"height":1587},"primaryImageOfPage":{"@id":"https:\/\/otus.ru\/journal\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\/#mainImage"},"datePublished":"2026-09-24T09:00:00+00:00","dateModified":"2026-09-25T15:25:20+00:00"},{"@type":"WebSite","@id":"https:\/\/otus.ru\/journal\/#website","url":"https:\/\/otus.ru\/journal\/","name":"OTUS \u0416\u0443\u0440\u043d\u0430\u043b - \u0411\u043b\u043e\u0433 \u043f\u0440\u043e IT","alternateName":"OTUS \u0416\u0443\u0440\u043d\u0430\u043b","description":"\u0411\u043b\u043e\u0433 \u043f\u0440\u043e IT","inLanguage":"ru-RU","publisher":{"@id":"https:\/\/otus.ru\/journal\/#organization"}}]}},"aioseo_meta_data":{"post_id":"9248","title":"jQuery AJAX: $.ajax, $.get, $.post \u0438 \u0430\u043d\u0430\u043b\u043e\u0433 \u043d\u0430 fetch | Otus","description":"\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c jQuery AJAX \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435: $.ajax, $.get, $.post, .done \u0438 .fail, \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 JSON, \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0442\u043e\u0442 \u0436\u0435 \u043a\u043e\u0434 \u043d\u0430 fetch \u0431\u0435\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.","keywords":[],"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2024-02-18 15:18:42","updated":"2026-09-25 18:08:36","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/otus.ru\/journal\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/otus.ru\/journal\/category\/polza\/\" title=\"\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435\">\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tjQuery AJAX: \u0437\u0430\u043f\u0440\u043e\u0441\u044b $.ajax, $.get, $.post \u0438 \u0438\u0445 \u0430\u043d\u0430\u043b\u043e\u0433 \u043d\u0430 fetch\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/otus.ru\/journal\/"},{"label":"\u041f\u043e\u043b\u0435\u0437\u043d\u043e\u0435","link":"https:\/\/otus.ru\/journal\/category\/polza\/"},{"label":"jQuery AJAX: \u0437\u0430\u043f\u0440\u043e\u0441\u044b $.ajax, $.get, $.post \u0438 \u0438\u0445 \u0430\u043d\u0430\u043b\u043e\u0433 \u043d\u0430 fetch","link":"https:\/\/otus.ru\/journal\/ajax-i-zaprosy-s-ego-pomoshhju-jquery-i-ego-primenenie-dlya-asinhronnyh-zaprosov\/"}],"_links":{"self":[{"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/posts\/9248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/comments?post=9248"}],"version-history":[{"count":3,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/posts\/9248\/revisions"}],"predecessor-version":[{"id":12860,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/posts\/9248\/revisions\/12860"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/media\/9249"}],"wp:attachment":[{"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/media?parent=9248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/categories?post=9248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/otus.ru\/journal\/wp-json\/wp\/v2\/tags?post=9248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}