Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2010
    Enschede, Netherlands
    Thanked 0 Times in 0 Posts

    IFRAME and new tab/new window


    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?!!?

  2. #2
    Regular Coder mbaker's Avatar
    Join Date
    Jan 2010
    Burford, Oxfordshire, United Kingdom
    Thanked 39 Times in 39 Posts
    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.
    - Michael Baker - HTML Tags Guide - Reference and Tutorials
    - Like voting, validate early, validate often - W3C HTML Validator - W3C CSS Validator
    - Wot? me cynical? no, its just if you vote, er, validate early, you have more chance of validating often.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts