Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Javascript/jQuery获取其他网页的元素_Javascript_Jquery_Ajax - Fatal编程技术网

使用Javascript/jQuery获取其他网页的元素

使用Javascript/jQuery获取其他网页的元素,javascript,jquery,ajax,Javascript,Jquery,Ajax,我需要更新2个表。每个表在另一个网页上。我使用javascript从数据库中删除对象,并从两个表中删除行。但是javascript只能从该文档的表中删除该行 简单地说:我无法从其他网页获取table元素。搜索了一段时间后,我发现我必须使用jQuery/Ajax来完成它,但我无法修复它。这是我的代码的一部分: function deleteItem(action,cdplayer,index){ //using ajax to delete the object from database

我需要更新2个表。每个表在另一个网页上。我使用javascript从数据库中删除对象,并从两个表中删除行。但是javascript只能从该文档的表中删除该行

简单地说:我无法从其他网页获取table元素。搜索了一段时间后,我发现我必须使用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 

}

你说的另一页是什么意思?是否是尚未加载到浏览器窗口中的页面?如果是这样,您就不能使用客户端JS来操作它。您有一个文档元素。您是说要使用服务器的“推送”更新客户端浏览器中的数据吗?