简体   繁体   English

从iframe访问主站点中的工作javascript

[英]Access work javascript in main site from iframe

I have a problem with the script loaded from outside site. 我从外部站点加载的脚本有问题。 Sometimes not loaded and all script in main site is stoped by core js in browsers. 有时未加载,并且主站点中的所有脚本都被浏览器中的核心js停止。

I put the script into the iframe. 我将脚本放入iframe。 JS wants to eliminate the influence of the iframe to the main page and do not know how to do it. JS希望消除iframe对主页的影响,并且不知道该怎么做。

SECURITY="restricted"? SECURITY =“ restricted”?

parent.document

should give you the parent document. 应该给您父文件。 If you want anything else in the parent window, use the "parent" instead of "window". 如果在父窗口中还有其他需要,请使用“父”而不是“窗口”。
This works in firefox, but the newer IE is very restricted with javascript. 这可以在firefox中使用,但是较新的IE受到javascript的限制。 I don't know if they are gonna let you do it 我不知道他们是否会让你这样做

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM