I have got a situation where I call .load()
with a jsp which returns a html table and values extracted from database.
Every time there is a change through insert
, update
or delete
, .load() is called.
function showResponse(responseText, statusText, xhr, $form)
{
var success = "Success";
var updated = "Updated";
var deleted = "Deleted";
if(responseText.substr(0,7) == updated)
{
document.getElementById('editForm').reset();
document.getElementById('editFormDiv').style.display = 'none';
retrive();
return;
}
if(responseText.substr(0,7) == success)
{
document.getElementById('addBeneficiary').reset();
document.getElementById('otherBank').style.display = 'none';
document.getElementById('bene_name').focus();
document.getElementById('editFormDiv').style.display = 'none';
retrive();
return;
}
if(responseText.substr(0,7) == deleted)
{
retrive();
return;
}
}
function retrive()
{
$('#updateEditResults').load('retriveBeneficiaryDetails.jsp?process=u');
$('#updateDeleteResults').load('retriveBeneficiaryDetails.jsp?process=d');
}
Now whenever I call it after delete and update, the updated database (with record deleted / edited) is shown. But after insert sql statement the changes are 开发者_开发百科not reflected.
精彩评论