Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.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
Google chrome 无法在firefox中更改iframe。类似于沙箱_Google Chrome_Firefox_Iframe_Cross Domain_Sandbox - Fatal编程技术网

Google chrome 无法在firefox中更改iframe。类似于沙箱

Google chrome 无法在firefox中更改iframe。类似于沙箱,google-chrome,firefox,iframe,cross-domain,sandbox,Google Chrome,Firefox,Iframe,Cross Domain,Sandbox,我已经在我的页面上添加了iframe。iframe的src是来自另一个域的页面(我与它们进行了跨域通信)。当我打开iframe时,我需要用另一个页面来更改它。对于Chrome,我是这样做的: frames['iframe_id'].location.href=URL; iframe.sandbox = 'allow-forms allow-scripts allow-same-origin'; 我如何在Firefox中做类似的事情?解决了,简单的方法: var iframe=docu

我已经在我的页面上添加了iframe。iframe的src是来自另一个域的页面(我与它们进行了跨域通信)。当我打开iframe时,我需要用另一个页面来更改它。对于Chrome,我是这样做的:

    frames['iframe_id'].location.href=URL;
iframe.sandbox = 'allow-forms allow-scripts allow-same-origin'; 
我如何在Firefox中做类似的事情?

解决了,简单的方法: var iframe=document.getElementsByName(“id”)

document.getElementById('id').src=URL

已解决。Firefox不需要沙盒之类的东西