The scenario is relatively common – you have a page that contains an iframe pointing to some content hosted on another domain. Nothing wrong with this – iframes were designed with this in mind! The following diagram shows the sort of setup we are talking about.
Communication from an iframe that has content from a domain other than the one the iframe is contained within is a constant source of frustration – as browsers prevent this kind of activity due to built-in security policies. The solution is actually relatively painless requiring the addition of an iframe (see the following diagram).
Real world example
You can see a working example of this over at Sky Movies where the iframe is resized as the content within the iframe changes. This is being controlled from within the iframe.
Why do we need to implement a solution like this in the first place?
Because whilst the main page at movies.sky.com can set the height of the iframe, it cannot get the height of the iframe content… and the iframe document can get its height but it can’t set the height of its enclosing iframe.
An explanation of each component of the solution
Using the following example pages, we can create a demonstration of this technique. Following is the source of the main page (marked as  in the figure above) which contains the iframe and the function that will be used to resize the iframe.
Obviously you would not be using example.com and example.org for your solution, they are used merely to identify the different domains you would use for each file.