Setting iFrame Height to Its Contents ...

I have an iFrame and I want it to expand / contract to fit its contents. The following code works on "some" of the loaded pages within the iframe, but on others it doesn't. I think the "Hgt2" below is what I need, that is the one that returns "null"; the other two return actual values.

I pulled some of this from Googling my issue, the statement below are the core of what I found to do but they don't work across the board.

What I need, I think, is the body height of the page that is being loaded into the iframe, but how do I get that value "consistently"??

If the page being loaded are from a different domain, then any reference to the window or document object of the loaded page will fail because cross-domain scripting is a security violation that is enforced

If the page being loaded are from a different domain, then any reference to the window or document object of the loaded page will fail because cross-domain scripting is a security violation that is enforced in every modern browser.

Everything is within the same base domain, on our website. When I say base domain, I mean test.mydomain.com. But, it seems that the one page that returns values is a static page on the web server itself, whereas the other pages are "loaded" from our internal server, meaning the html page is not on the web server, it resides on our internal server. It is sort of like JAVA in that the JAVA code is not on the web server, it's on a server that is called.

Would that matter? It seems coincidental, maybe I should test that some.

Featured Post

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Introduction
JSON is an acronym for JavaScript Object Notation. It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner. Similar in concept to XML, but more e…

In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS
Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…