Usually if we want to get some data with AJAX we do something like that:
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && xhr.status == 200){
elem.innerHTML = xhr.responseText;
}
}
And the question is - can we get the result not as elem.innerHTML but as is?
I mean:
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && xhr.status == 200){
xhr.responseText;
}
}
The problem is that result of my query is HTML-table made by PHP and I don't want to wrap it with some other elements.