hi all, i started my learning in ajax doing a web application that emulates a sort of spreadsheet (similar to excel).
so i have a jsp page that through ajax calls the server making a SELECT and display a table full of input texts (something similar to this):
function alertContents() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
result = http_request.responseText;
document.getElementById('target').innerHTML = result;
}
else {
alert('Attenzione, è stato riscontrato un problema dal server.');
}
}
}
now, the problem comes in the alertContents function: as during the update i just send informations to the server and don't receive anything as a result, i don't want the line
document.getElementById('target').innerHTML = result;
to be executed, because it replaces the page with just anything and so doesn't show the table anymore.
i tried with a global variable as a flag, but it doesn't work. i also tried passing a parameter but nothing seems to happen.. (the problem is caused by my short experience in js) :(
what can i do?
thanks ;)
Why don't you send something back in the response like Update~Successful.