If a page should be in an Iframe and is opened in a top browser window the following script will open the parent page and load the page into its Iframe.
In the parent page.
<script type="text/javascript">
<!--
function loadIframe(){
if (location.search.length > 0){
loc=unescape(location.search.substring(1))
window.frames["iframe_name"].location=loc
}
}
// add onload="loadIframe()" to the opening BODY tag
// -->
</script>
<iframe name="iframe_name" src="page1.htm"></iframe>
In the page(s) loading into the iframe
<script type="text/javascript">
<!--
if (top.location.href.indexOf("parent_page_name.htm") == -1){
top.location.href = "parent_page_name.htm?iframe_page_name.htm"
}
// -->
</script>
Note:
In the second line of the above code the path to the files must be relative to where they are in relation to each other.