Fetch
Обновлено: 09.03.2023
Визначення та використання
Метод fetch()запускає процес отримання ресурсу з сервера.
Метод fetch()повертає Promise, який вирішує об’єкт Response.
😀 Більше не потрібен XMLHttpRequest.
Синтаксис
fetch(file)
Параметри
| Parameter | Description |
| file | Optional. The name of a resource to fetch. |
Повернене значення
| Type | Description |
| Promise | A Promise that resolves to a Response object. |
Browser Support
fetch() is not supported in Internet Explorer 11 (or earlier).