Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/86.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 调整从其他域加载的iframe/object标记的内容大小_Javascript_Html_Cross Domain - Fatal编程技术网

Javascript 调整从其他域加载的iframe/object标记的内容大小

Javascript 调整从其他域加载的iframe/object标记的内容大小,javascript,html,cross-domain,Javascript,Html,Cross Domain,我有一个脚本,它加载指向内容的链接,并在iframe或object标记中显示。当内容与脚本位于同一服务器上时-我可以使用 iFrameObject.contentDocument().getElementsByTag().width= 但当内容在其他服务器上时,我遇到了跨域限制。 请给我一个建议,就是(以及如何)在不使用其他框架的情况下解决这个问题,只需使用HTML和Javascript您就无法读取或写入从其他域加载的iFrame的属性。就这些 一些资源: 如果您有权访问iframe脚本

我有一个脚本,它加载指向内容的链接,并在iframe或object标记中显示。当内容与脚本位于同一服务器上时-我可以使用

iFrameObject.contentDocument().getElementsByTag().width=

但当内容在其他服务器上时,我遇到了跨域限制。
请给我一个建议,就是(以及如何)在不使用其他框架的情况下解决这个问题,只需使用
HTML
Javascript

您就无法读取或写入从其他域加载的iFrame的属性。就这些

一些资源:


如果您有权访问iframe脚本,则可以将其
document.domain
设置为与父脚本匹配。