Forum Moderators: open
I have a page with two iframes to simulate hierarchal navigation in one self-containing page. First, a user makes their selection from the first level of hierarchy via a drop-down box that is contained in the parent page. Then, the second level of hierarchy is displayed in the first iframe. From here, they make a selection from the second level of hierarchy, which displays the content in the second iframe.
This navigation works swimmingly in IE6, Opera, FF, Safari, and Konqueror. However, IE7 brings up the content that should be displayed in the second iframe in a new window.
I have found that by changing the following setting:
Internet Options -> Security -> Change level -> "Navigate sub-frames across different domains" to "enable" (which is the default for IE6 and below), IE7 displays the content correctly.
Naturally, I don't want to have to instruct all users of IE7 to change this setting. I'm looking for a workaround that will allow this behavior regardless of the aforementioned setting. Any suggestions or help is greatly appreciated.
Here is a simple diagram of the layout:
dropdown1
_________________
iframe1-dropdown2
_________________
____________________
iframe2-main content
____________________
How do you identify the target iframe - with an id or name attribute, or both? Also, is the document you hope to display in the second iframe really on a different domain?
I also have a small suspicion about the dropdown - are the selections javascript? IE7 may have changed their jscript support in some way. The fact that the dropown is also in an iframe also makes targeting another iframe more complex - and there may be some new security "feature" in play. I'm also not totally clear why you need 2 separate iframes. On the surface that sounds needlessly complex, but I realize you may have your reasons.
One last item crossed my mind -- it seems to be quite telling that IE7 does display the new page, just in a new window. If this was just a security thing, I would expect the new document just to be blocked. This behavior almost sounds like a spelling discrepancy in the code somewhere.
Both iframes are identified with id and name attributes, and the document being targeted in the second iframe is, as you speculated, not on a different domain. The dropdown menu is javascript.
I will research IE7's jscript and iframe behavior to try and find a solution. If I figure anything out, I'll be sure to post my work-around, though I definitely agree that I have made this a lot harder than it really needs to be ;)
Thanks again for your assistance.