0

我已经尝试过这里提到的各种方法来让 iframe 改变高度。它适用于原始 src 域的初始加载,但是当在 iframe 内单击指向子域 s 的链接时,我收到以下错误:

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.profiledata.co.za') does not match the recipient window's origin ('https://funds.profiledata.co.za').

URL:https ://www.iol.co.za/business-report/market-indicators 点击 Funds 获取子域。

我已经尝试将 checkOrigin 设置为 false 以及其中包含两个域的数组,但我仍然遇到相同的错误。它不会调整子域页面上的 iframe 的大小。任何想法,谢谢。

4

1 回答 1

-1

尝试在选项中添加 heightCalculationMethod: 'bodyScroll' 。或尝试更改此选项的值。您可以在http://davidjbradshaw.github.io/iframe-resizer/中看到 heightCalculationMethod 的所有值

iFrameResize({log:true,
  autoResize:true,
  checkOrigin:false,
  interval:32,
  heightCalculationMethod: 'bodyScroll'
});
于 2017-09-25T09:09:08.897 回答