iframe中从子级到父级的跨域访问 [英] Cross-domain access in iframe from child to parent

查看:219
本文介绍了iframe中从子级到父级的跨域访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当iframe中加载的页面来自另一个域时,我们如何从iframe中加载的文档中访问父文档?

How do we access parent document from a document loaded inside an iframe when the page loaded inside iframe is from another domain?

我收到权限被拒绝错误。

I am getting a permission denied error.

推荐答案

如果你有两个文件的控制权,那么你就可以轻松使用easyXDM( http://easyxdm.net )在他们之间进行沟通。
使用它的一个简单易用的例子可以在 http://找到consumer.easyxdm.net/current/example/methods.html

if you have control of both documents, then you could easily use easyXDM (http://easyxdm.net) to communicate between them. A nice and easy example of using it can be found at http://consumer.easyxdm.net/current/example/methods.html

这篇关于iframe中从子级到父级的跨域访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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