Показать сообщение отдельно
  #7 (permalink)  
Старый 10.01.2018, 23:40
Профессор
Отправить личное сообщение для Артист Посмотреть профиль Найти все сообщения от Артист
 
Регистрация: 25.09.2016
Сообщений: 163

function GetHttpRequest(href) // Get запрос на url
{
	var xhr = new XMLHttpRequest()
	xhr.withCredentials = true
	xhr.onreadystatechange = function()
	{
		var xhr = this

		if(xhr.readyState != 4 || xhr.status != 200) return
		
		var html = xhr.responseText
		
		alert(html)
		console.log(html)
	}
	xhr.open('GET', href, true)
	xhr.send(null)
}
GetHttpRequest('https://javascript.ru/forum/misc/72129-vyvod-bolshogo-teksta.html')
Ответить с цитированием