开发者

.load() jquery with JSP and Access Database

开发者 https://www.devze.com 2023-04-08 11:10 出处:网络
I have got a situation where I call .load() with a jsp which returns a html table and values extracted from database.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消