我尝试过这里提到的各种方法来让iframe改变高度。它适用于原始src域的初始加载,但是当在iframe内部点击子域的链接时,我收到以下错误:
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').
网址:https://www.iol.co.za/business-report/market-indicators 单击“资金”以获取子域。
我已经尝试将checkOrigin视为false以及包含两个域的数组,但我仍然得到相同的错误。它不会调整子域页面上的iframe大小。任何想法,谢谢。
答案 0 :(得分:0)
尝试添加heightCalculationMethod:' bodyScroll'在选项中。或尝试更改此选项的值。你可以在http://davidjbradshaw.github.io/iframe-resizer/
中看到heightCalculationMethod的所有值iFrameResize({log:true,
autoResize:true,
checkOrigin:false,
interval:32,
heightCalculationMethod: 'bodyScroll'
});