我从一个窗口有一个html表.我通过使用得到了表
var table = document.getElementById('tableId');
Run Code Online (Sandbox Code Playgroud)
然后我用以下方法打开另一个窗口:
window.open('newWindow.html');
Run Code Online (Sandbox Code Playgroud)
在这个窗口中,有一个id = divId的div.
现在,如果我尝试通过以下代码从其他窗口追加表:
var cloneTable = jQuery.extend(true, {}, window.opener.table);
var div = document.getElementById('divId');
div.appendChild(cloneTable);
Run Code Online (Sandbox Code Playgroud)
Internet Explorer将抛出此错误:
SCRIPT5022:HierarchyRequestError
我已经搜索了错误代码,如下所示:
http://msdn.microsoft.com/en-us/library/ie/gg592979(v=vs.85).aspx
它说我无法在该位置插入节点.但是,上面的代码在Firefox和Chrome中运行良好.
这里发生了什么以及如何解决这个问题?
谢谢,
PS:我正在使用IE 10