无法从iFrame目标网站接收parent.postMessage. [英] Unable to Receive parent.postMessage from iFrame Target Site.

查看:365
本文介绍了无法从iFrame目标网站接收parent.postMessage.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前正在将iFrame更新到我的网站.
使用postMessage调整iFrame的高度.

I am currently update an iFrame to my site.
the iFrame height is adjusted by using postMessage.

我从目标iFrame网站发送了parent.postMessage(height,'*').
然后通过窗口事件在父项上收到它.

I sent parent.postMessage(height,'*') from my target iFrame site.
then received it on parent with a window event.

当我使用旧站点时,它可以按预期运行.正在显示目标站点,正在通过postMessage调整高度.

When I am using my old site, it is working as expected. Target site is being displayed, height is being adjusted by postMessage.

但是当我尝试使用新站点时,iFrame内将显示新目标"站点,但是父站点没有收到postMessage.

But when I tried using the new site, New Target site is being displayed inside iFrame, but the parent site does not receive the postMessage.

我可以要求您提供有关此问题的意见.

May I please request for your inputs regarding this issue.

注意:我已经添加了< WebPartPages:AllowFraming runat ="server" />.  
https://stackoverflow.com/questions/7532315/cross-domain-iframe-resizer-using-postmessage?rq=1

Note: i have already added <WebPartPages:AllowFraming runat="server" />.  
IE compatibility is also added 
https://stackoverflow.com/questions/7532315/cross-domain-iframe-resizer-using-postmessage?rq=1





推荐答案

旧站点和新站点之间有区别吗?

Are there differences between the old site and new site?

对于此问题,请在新站点上调试您的JS代码,以检查可能导致此问题的代码.

For this issue, please debug your JS code on the new site to check which code may cause this issue.

有一些类似的线程供您参考,请检查它们是否对您有用:

There are some similar threads for your reference, please check if they are useful for you:

https://sharepoint.stackexchange.com /questions/145655/page-viewer-webpart-iframe-auto-resize-on-content

谢谢

Wendy


这篇关于无法从iFrame目标网站接收parent.postMessage.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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