I have a file where I send GET request to another file, and I got the response show up under Network tab of Google Dev Tools, but it did not display on my browser.
This is what I do for passing the response to display in my browser.
xmlhttp.onreadystatechange = function() {
if(this.readyState == 4){
res = xmlhttp.responseText;
document.getElementById('table3').innerHTML = res;
}
}
And I want to display the response under the table of id = "table3" like below.
<td id="table3">
<td>
The content inside was passing from the response of GET request.
Any help is appreciated. Thank you
I think that your if statement in the
onreadystatechangecallback is wrong. xmlhttp is the instance of the XHR class, which would mean that instead of usingthis, you would have to usexmlhttp, and notthis.thisin the context of your program likely is thewindowobject.