从Parent执行iFrame中的Javascript [英] Executing Javascript in iFrame from Parent

查看:106
本文介绍了从Parent执行iFrame中的Javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是一个抬头我是JavaScript的半菜鸟。

Just a heads up I am a semi noob at JavaScript.

所以过去两天我一直在谷歌和我的生活中我无法弄清楚如何从父页面执行iframe中的函数。 iframe中的页面位于不同的域中,要执行的代码通常通过链接执行,但我希望它在没有用户点击链接的情况下执行。

So for the past two days I have been googleing and for the life of me I cannot figure out how to execute a function in an iframe from the parent page. The page in the iframe is on a different domain and the code to be executed is usually executed via a link, but I want it to be executed without have the users click on the link.

我希望这有点道理。如果你们想看到我到目前为止的内容只是让我知道,但我认为它不会有太多帮助,因为它根本不起作用。

I hope that made some sense. If you guys would like to see what I have so far just let me know, but I don't think it would be of much help since it doesn't work at all.

推荐答案

AFAIK,你无法从另一个域中的其他域执行JavaScript (肯定是 Mozilla )。

AFAIK, you can not execute JavaScript from a different domain in another fram due to security restrictions in most browsers (definitely Mozilla).

我听说过有关 Yahoo!管道但必须是我从未调查过的,因此不知道是否是这种情况。

I have heard rumors of a way around that with Yahoo! Pipes but must cofess that I never investigated that so don't know if that is the case.

只需谷歌同源策略解决方法并查看如果列出的任何变通方法符合您的目的。

Just google for "same origin policy workaround" and see if any of the workarounds listed serve your purpose.

这篇关于从Parent执行iFrame中的Javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆