Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Codeasaurus Rex
    Join Date
    Jun 2008
    Location
    Redmond, WA
    Posts
    660
    Thanks
    31
    Thanked 100 Times in 94 Posts

    Prevent Iframe from redirecting parent

    Hey all,

    Now chances are this is a JS related question but to be on the same side I figured I would post it in a more generic section.

    I've designed a web page that basically has a header, and then an iframe containing an external site (very similar in fashion to a Google Image search, though I display information in the header).

    Unfortunately though the site initially loads fine into the iframe, and I login fine to the iframe when I open up a menu option in the external site that page loads in the parent frame instead of the iframe, thus eliminating the header.

    Any suggestions on how to prevent an iframe page from redirecting the parent frame would be much appreciated.

    Thanks!

    PS: In case you're worried about this being phising or advertising related. don't worry - it's for a school voting drive and I'm trying to display the list of candidates at the top.
    Unless otherwise stated, any code posted is most likely untested and may contain syntax errors.
    My posts, comments, code, and suggestions reflect only my personal views.
    Web Portfolio and Code Snippets: http://shanechism.com

  • #2
    Regular Coder
    Join Date
    Aug 2008
    Location
    Northern Ireland
    Posts
    167
    Thanks
    12
    Thanked 6 Times in 6 Posts
    I don't think there is anything you can do to stop this, because the code that would make the site open a link in the parent window is on their site. The same problem would occur if you used frames.

  • #3
    Codeasaurus Rex
    Join Date
    Jun 2008
    Location
    Redmond, WA
    Posts
    660
    Thanks
    31
    Thanked 100 Times in 94 Posts
    There's got to be a way around it, though. Embed it in a flash client? insert a browser window in a browser window? Side step ways.

    Any ideas?
    Unless otherwise stated, any code posted is most likely untested and may contain syntax errors.
    My posts, comments, code, and suggestions reflect only my personal views.
    Web Portfolio and Code Snippets: http://shanechism.com

  • #4
    Regular Coder
    Join Date
    Aug 2008
    Location
    Northern Ireland
    Posts
    167
    Thanks
    12
    Thanked 6 Times in 6 Posts
    http://orangoo.com/labs/GreyBox/

    I posted this in another topic here yesterday, it doesn't 100% do what you are looking for, but there may be a way to edit it to encorperate the heading information you want.


  •  

    Posting Permissions

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