We are trying a access various DOM elements from full HTML pages that are remotely fetched via XHR GET request.
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://www.example.com/test.html", true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
var newdom = xhr.responseText;
var val_result = newdom.a_div.innerText;
// we want to access the text within this div, from the fetched html page?
}
}
xhr.send();
Any ideas?