Problem with iframe, links, and redirects
September 19, 2007 10:52 AM
Subscribe
I have a problem where I show a document within an iframe, and I wish to have links clicked within the iframe show in the toplevel window instead of the iframe. But there's a twist...
I can't (easily) modify the documents that are shown within the iframe.
The problem that comes about is, the target of these links has a bit of javascript that says "Am I in the toplevel window? No? Then set the toplevel href to my href". This nicely accomplishes the task of making sure the document displays in the toplevel and not the iframe.
However, this breaks the back button, because "back" goes b ack to where the current page is in the iframe, and it redirects forward again. This also breaks my nice javascript:history() back button.
Is there any way with css, javascript, iframe options, etc, to make sure that all links clicked within an iframe open in the parent frame?
posted by RustyBrooks to computers & internet (4 comments total)
posted by RustyBrooks at 10:55 AM on September 19, 2007