I have had success before in getting back to the parent window but never thought about an IFRAME that hogged the limelight.
All the code here is in and around the IFRAME.
1. Add the Name UsesJQuery to the IFRAME.
2. In its Head, include:
Code:
<script>$(document).ready(function() {
$('html').attr('id', 'parent');
$('#emptyiframe').attr('src', 'index.htm');
});
</script>
This adds an ID to the parent page that is needed to invoke it.
3. In its body, include:
Code:
<script>var initialFocus = false;</script>
<iframe src="index.htm" id="iframethatstealsfocus" width="100%" height="100%" frameborder="0" scrolling="auto" name="iframe" onfocus="if (initialFocus==false) { document.getElementById('parent').focus(); initialFocus = true; }"><p>Your browser does not support iframes.</p></iframe>
Change the source attribute to your IFRAME destination URL.
The variable initialFocus is to ensure the first visit forces back to the parent windwo. Thereafter, the user has chosen to go into the IFRAME.
Acorn
Bookmarks