View Full Version : IFRAME and new tab/new window

07-07-2010, 04:06 PM

I have a problem with IFRAMEs , I have to use I frame in a case, everything is fine but when I click a link inside and select open in new tab or in new window, the next window will contain only the IFRAME and everything is gone! I mean the main body which should hold the IFRAME. is there a trick for this?!!?

07-08-2010, 01:08 AM
I don't think there are any tricks. The behaviour you are describing is the behaviour that I would expect from any webbrowser.

Have you considered adding some javascript to the pages linked to, that checks to see if the page has been opened inside of the correct iframe?

If it has not it could re-open the original page, passing a query string giving the page to open in the iframe.

This would require some corresponding javascript on your main page (that has the iframe) that would check for the query string, and if present open the specified page in the iframe instead of the default page in the iframe.

This will only work if you have control over the pages that are being opened inside of the iframe.

Also it won't work for the 10% or so of your visitors who do not have javascript enabled.