I was wondering if there was a method to update a cell in a table that had a unique id? Something with <td id="xxxxx"></td> or in a <div> tag. The table will have hundreds of cells.
Here is my quick and dirty code (stolen from here ):
Code:
function getXmlHttpRequestObject() {
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
} else if(window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
} else {
alert("Your browser doesn't support the XmlHttpRequest object. Better upgrade to Firefox.");
}
}
var receiveReq = getXmlHttpRequestObject();
function sayHello() {
if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
receiveReq.open("GET", 'SayHello.html', true);
receiveReq.onreadystatechange = handleSayHello;
receiveReq.send(null);
}
}
function handleSayHello() {
if (receiveReq.readyState == 4) {
document.getElementById('span_result').innerHTML = receiveReq.responseText;
}
}
The way I'm trying to do it is pass a variable into the "handleSayHello" function so it would change the element ID that matches the variable (or "the individual cell"). When I try that nothing happens. Thanks.