.load() jquery 与 JSP 和 Access 数据库
我遇到过这样的情况:我使用 jsp 调用 .load()
,该 jsp 返回一个 html 表和从数据库中提取的值。
每次通过 insert
、update
或 delete
进行更改时,都会调用 .load()。
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');
}
现在,每当我在删除和更新后调用它时,都会显示更新的数据库(记录已删除/编辑)。但是插入sql语句后,更改没有反映出来。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论