Results 1 to 3 of 3

Thread: keep HREF=Page References within iframe

  1. #1
    Join Date
    Dec 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question keep HREF=Page References within iframe

    I have an iframe defined as follows:
    <iframe src="http://thephotofinishes.com" target="_self">Sorry Iframe connection does not work in your browser</iframe>

    Now what I want is all clicks in the iframe on thePhotoFinishes.com to stay within the iframe (hence the attempt with target="_self" to control this).

    This would allow me to conduct a "live help" session depending on what link the user follows while working in the photofinishes.com. Now the thephotofinishes.com' tabs work and stay within the iframe because they are javascripted changes to the same loaded page. But any click on a link/reference to a page external to the current thePhotoFinishes.com page causes the iframe to be ignored and thenew destination page to be loaded in the browser window wiping out my Dynamic Help session.See
    If I get users to right mouse click on a menu or link I can at least get the Dynamic Help session preserved as the link opens in a new tab or Window ... but this is clumsy and ignored by more than half of my test users [5 guinea pigs so far]

    Any solution using HTML and/or JavaScript will be welcome.

    See here for an example of the type of thing I want to do - go to the Google tab - and then look up thephotofinishes.com and see if you can stay within the iframe.
    -----------------------------------------------------------------------
    By the way HTML has really been stagnated on allowing website developers to target where href clicks should go - 1)another window, 2)another existing tab, 3)a new tab or 4)overwriting the existing page. Does anybody know if this gets addressed in HTML 5?

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Quote Originally Posted by jbsurveyer View Post
    By the way HTML has really been stagnated on allowing website developers to target where href clicks should go - 1)another window, 2)another existing tab, 3)a new tab or 4)overwriting the existing page. Does anybody know if this gets addressed in HTML 5?
    http://www.w3.org/TR/html5-diff/#new-attributes
    The base element can now have a target attribute as well, mainly for consistency with the a element. (This is already widely supported.) Also, the target attribute for the a and area elements is no longer deprecated, as it is useful in Web applications, e.g. in conjunction with iframe.

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    No. You cannot really control another site in your iframe if that site has code to break out of frames on it. Nor, should you be able to. If a site wants their content not to be en-framed, they have a right to do that.

    Using a server side language, if your server permits this, you may capture the served code of the other page, alter it, and serve it from your own site. However, this is just like copying the other site and would be illegal here (the thephotofinishes.com site's content is copyrighted).

    Since we are not allowed by the forum rules to help people break the law, I'm closing this thread.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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