From 980fe00a74a9ad013b945755415ace2e5429c3c2 Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Wed, 27 Oct 2021 02:31:24 +0300 Subject: [RU] Remove notranslate (#2874) --- files/ru/web/api/response/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'files/ru/web/api/response/index.html') diff --git a/files/ru/web/api/response/index.html b/files/ru/web/api/response/index.html index e32d4d23b9..969c6d288f 100644 --- a/files/ru/web/api/response/index.html +++ b/files/ru/web/api/response/index.html @@ -93,7 +93,7 @@ translation_of: Web/API/Response

You'll notice that since we are requesting an image, we need to run {{domxref("Body.blob")}} ({{domxref("Response")}} implements Body) to give the response its correct MIME type.

-
const image = document.querySelector('.my-image');
+
const image = document.querySelector('.my-image');
 fetch('flowers.jpg').then(function(response) {
   return response.blob();
 }).then(function(blob) {
@@ -103,13 +103,13 @@ fetch('flowers.jpg').then(function(response) {
 
 

You can also use the {{domxref("Response.Response()")}} constructor to create your own custom Response object:

-
const response = new Response();
+
const response = new Response();

Ajax запрос

Здесь мы с помощью функции doAjax вызываем PHP скрипт, который генерирует JSON строку, и возвращает распарсенный JSON в виде JavaScript объекта. Также реализована простая обработка ошибок.

-
// Функция, которая делает Ajax запрос
+
// Функция, которая делает Ajax запрос
 const doAjax = async () => {
     const response = await fetch('Ajax.php'); // Генерируем объект Response
     if (response.ok) {
-- 
cgit v1.2.3-54-g00ecf