Javascript 当子对象来自其他域时更改iframe高度

Javascript 当子对象来自其他域时更改iframe高度,javascript,jquery,iframe,cross-domain,Javascript,Jquery,Iframe,Cross Domain,我正在使用Facebook应用程序,Facebook应用程序需要将你的应用程序放入iFrame, 一切都很顺利,除了高度,如果创建的iframe是静态的,我想更改iframe的高度, 我尝试了以下方法: jQuery(parent.document.body.getElementsByTagName('iframe')).load(function() { this.style.height = this.contentWindow.document.body.offsetHeight

我正在使用Facebook应用程序,Facebook应用程序需要将你的应用程序放入iFrame, 一切都很顺利,除了高度,如果创建的iframe是静态的,我想更改iframe的高度, 我尝试了以下方法:

jQuery(parent.document.body.getElementsByTagName('iframe')).load(function() {
  this.style.height =
  this.contentWindow.document.body.offsetHeight + 'px';
});
但在尝试访问父文档时

parent.document
发生错误

Unsafe JavaScript attempt to access frame with URL  
http://www.facebook.com/somthing/app_100550322222338 from frame with URL 
http://z.me/facebook/whatsnew. Domains, protocols and ports must match.

是否有其他解决方案???

没有客户端脚本解决方案,因为页面和iframe来自不同的域

如果您在服务器上设置了一个代理页面来获取facebook页面,浏览器会认为它们来自同一个域,那么脚本就可以工作了