Iframe-Resizer is not working on cross domain.
See original GitHub issueHi,
Iframe-resizer first benefit “height and width resizing of the iFrame to content size.” is not working. i tried all methods but didn’ work. And couldn’t use any method of plugin (getpageinfo, getid etc).
Page A (Main) Im calling iframeResizer.js on main page. jquery codes:
$("iframe#test").on("load", function () {
$('iframe#test').iFrameResize( [{
checkOrigin:false,
log:true,
enablePublicMethods : true,
heightCalculationMethod : 'max'
}] );
});
html codes:
<iframe id="test" width ="100%" src="http://www.myiframedomain.com" ></iframe>
Page B (http://www.myiframedomain.com) Im calling iframeResizer.contentWindow.min.js on Page B.
P.s: im loading last version of jquery both pages. Page A and B are different domains.
My main page console log is “[iFrameSizer][Host page: test] IFrame has not responded within 5 seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ingored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning.” (only 1 message. no have any error log.)
Problem: There is no change height of id#test iframe . While the page is first loading im seeing scrollbar of iframe ( height 100-150px - real iframe height 1700px) but suddenly scrollbar is closing (like overflow:hidden) and my iframe height still 100-150px. (page is loading in 2-3 seconds)
In summary; is not working. What is the wrong ? How can do it?
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
It would appear that the
iframeResizer.contentWindow.min.js
has not been loaded correctly in the iFrame.There is contentWindow JS in each page load . Can i destroy setup before loading. After again setup. (Destroy -Create cycle when page is loading).
i tried giving random classname to iframe. and selector is this random classname but still same error. 😕 ` $(“iframe#test”).on(“load change”, function () {
And Eror log is “[iFrameSizer][Host page: test] Ignored iFrame, already setup.”
i am thinking “i can not use class instead of id for selector” aren’t i?