I have the following code to get the content of multiple DIV’s. Im using AJAX.
I know that responseText would give me the result…but how do I break this response up in different chunks so I can assign it to the individual divs?
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("div1").innerHTML = responseText;
document.getElementById("div2").innerHTML = response?????;
document.getElementById("div3").innerHTML = response?????;
}
};
xmlhttp.open("GET","getstatistics.php",true);
xmlhttp.send();