如何从iframe的页面,其托管网页沟通? [英] How to communicate from iframe page with its hosting page?

查看:200
本文介绍了如何从iframe的页面,其托管网页沟通?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网页我有一个显示另一页的iframe。
我想从IFRAME到主机页面传递一些参数。

In my web page I have an iframe that displays another page. I want to pass some parameters from the iframe to the host page.

能不能做到?

推荐答案

通过服务器端code(你没有这个标签asp.net)?第包括iframe中先加载,所以它可以在iframe的数据传递到页面(通过查询字符串),但该网页无法周围的其他方式。

With server side code (you did tag this asp.net)? No. The page including the iframe loads first, so it can pass data to the page in the iframe (via a query string), but not the other way around.

通过客户端code?见怎样帧之间在Web浏览器进行通信?但要注意的局限性同源策略

With client side code? See How do I communicate between frames in a web browser? but be aware of the limitations of the Same Origin Policy.

这篇关于如何从iframe的页面,其托管网页沟通?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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