Before the "beating a dead horse" comments begin, let me clarify what I am trying to do to see if someone can help me.
I have a parent window with an iFrame in it. The content in the iFrame is loaded from a separate domain which is where I think my problems begin, although it needs to be this way. When the page originally loads I have the following running:
This works great. The iFrame doesn’t have any scrollbars and looks perfect to how I want. The problem I run into is the iFrame has a button that causes a post-back on the frame. I need to have this script run when the iFrame reloads itself to prevent any scrollbars from showing. Due to the child page being on a separate domain I’m not able to call a function from it to the parent (pretty sure this is where XSS comes into play) so I need to come up with another way for the parent to know it needs to run this script because the iFrame is reloading itself.
You could add a timer which checks and resizes at regular intervals:
setInterval( "resizeIframe()", 1000 ); //check every second
[Edit – links for resize scripts]
Check out http://geekswithblogs.net/rashid/archive/2007/01/13/103518.aspx and Resizing an iframe based on content for scripts on resizing an iframe.
Answered By – Mikael Svenson
Answer Checked By – Dawn Plyler (BugsFixing Volunteer)