跨域iframe是否可以检测浏览器的实际视口尺寸? [英] can an cross-domain iframe detect a browser's actual viewport dimensions?

查看:74
本文介绍了跨域iframe是否可以检测浏览器的实际视口尺寸?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在父页面中加载了一个iframe - iframe和父页面位于不同的域中。



我的iframed网站能否检测到实际的浏览器维度?

postmessage-plugin /rel =nofollow> http://benalman.com/projects/jquery-postmessage-plugin/



这允许跨域名通讯,您可以控制两个域名。


I have an iframe loaded inside a parent page - the iframe and parent page are on different domains.

Can my iframed site detect the actual browser dimensions?

解决方案

I ended up using the excellent postMessage plugin from Ben Alman

http://benalman.com/projects/jquery-postmessage-plugin/

this allows for cross domain communication where you have control over both domains.

这篇关于跨域iframe是否可以检测浏览器的实际视口尺寸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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