我需要更新2个表。其他网页上的每个表格。我使用javascript从数据库中删除对象并从2个表中删除该行。但javascript只能删除该文档中表格中的行。
简单地说:我无法从其他网页获取表格元素。经过一段时间的搜索,我发现我必须使用jQuery / Ajax,但我无法修复它。以下是我的代码:
function deleteItem(action,cdplayer,index){
//using ajax to delete the object from database
var information = "action=" + encodeURIComponent(action) + "&cdplayer=" + encodeURIComponent(cdplayer);
xHRObject.open("POST", "StockServlet", true);
xHRObject.setRequestHeader('Content-Type',
'application/x-www-form-urlencoded');
xHRObject.send(information);
//deleting the row from the table of that document
var table = document.getElementById("tableAdmin");
table.deleteRow(index);
//here i have to delete the table from the other document
}