Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/89.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访问父弹出div元素_Javascript_Jquery_Html - Fatal编程技术网

无法使用javascript访问父弹出div元素

无法使用javascript访问父弹出div元素,javascript,jquery,html,Javascript,Jquery,Html,我一直在写这个小脚本,翻译后的文本应该回到原来的位置。一切似乎都很好,但js仍然无法找到窗口对象。代码中有什么错误吗?我也试过newXWin.document,但没有用。请帮忙 函数DoMagic() { var newWin=window.open(“https://translate.google.com/#auto/es/This%20is%20a%20test%20sentence.%0AI%20think%20I%20should%20try%20this.“,“newXWin”,

我一直在写这个小脚本,翻译后的文本应该回到原来的位置。一切似乎都很好,但js仍然无法找到窗口对象。代码中有什么错误吗?我也试过newXWin.document,但没有用。请帮忙


函数DoMagic()
{
var newWin=window.open(“https://translate.google.com/#auto/es/This%20is%20a%20test%20sentence.%0AI%20think%20I%20should%20try%20this.“,“newXWin”,“宽度=500,高度=600”);
}
函数GetText()
{
警报(window.opener.document.getElementById(“结果框”).innerHTML+“”);
}

我看不到任何地方定义了
result\u box
。也许最好将var newWin设为全局变量,并在函数getText()中使用它。我看不到newWin在任何地方的使用了,这很奇怪…我看不到
result\u box
在任何地方定义的可能重复。也许最好将var newWin设为全局变量,并在函数getText()中使用它。我看不出newWin还有什么用了,这很奇怪……可能是