This question has already been answered:
- Getting item from another site 2 replies
How to get all the contents of an HTML page?
For example, https://ru.stackoverflow.com/ .
This question has already been answered:
How to get all the contents of an HTML page?
For example, https://ru.stackoverflow.com/ .
A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .
XMLHttpRequest is used for this purpose.
var http = new XMLHttpRequest(); http.open('GET', 'http://ru.stackoverflow.com', true); // составить асинхронный (по умолчанию true) GET запрос страницы http.onreadystatechange = function () { // обратная связь: отдаёт ответ на запрос if (this.readyState == 4 && this.status == 200) { // отследить момент, когда пришёл полный ответ alert( this.responseText ); // this.responseText — ответ в виде текста } } http.send(); // отправить запрос input ? - Mr. BlackAccess-Control-Allow-Origin - Mr. Blackvar content = document.body; content is page content
Source: https://ru.stackoverflow.com/questions/547389/
All Articles