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