This commit is contained in:
Valeria Fadeeva 2023-12-10 01:28:59 +05:00
parent d3cd5b77c5
commit 162be52f1d
1 changed files with 2 additions and 2 deletions

View File

@ -81,7 +81,7 @@ async function bodyFetch(url) {
if (response.ok) { // если HTTP-статус в диапазоне 200-299
// получаем тело ответа (см. про этот метод ниже)
let text = await response.text();
if (tplUrl == 'news.tpl.html') {fetchData();}
if (tplUrl == 'news.tpl.html') {await fetchData();}
body.innerHTML = text;
} else {
body.innerHTML = "Ой всё сломалось :(";
@ -142,7 +142,7 @@ let fetchPage = async function(evt) {
try {
const response = await fetch(tplUrl, { signal });
text = await response.text();
if (tplUrl == 'news.tpl.html') {fetchData();}
if (tplUrl == 'news.tpl.html') {await fetchData();}
} catch (error) {
// DOMException: The user aborted a request.
console.log('Error: ', error)