I have a webpage that uses the Javascript code below on a timer to execute a PHP script. That PHP script parses an XML file and extracts data, returns that data via "echo", which replaces the "replacement" div in the HTML page.
This is not working. If I have the PHP script return just basic text, or some simple HTML everything works fine. When I try to have it send back HTML tables, or even a row that is to be added into the table in the web page, it just simply doesn't appear and the div is left there with no replacement text. I need to add an HTML table or row to table from a PHP script. How can I do this?
Help is greatly appreciated!!
function completeTable() {
if (window.XMLHttpRequest) {
xmlhttp=new XMLHttpRequest();
} else {
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("replacement").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","php-parser.php",true);
xmlhttp.send();
}