Log in

View Full Version : keep HREF=Page References within iframe



jbsurveyer
12-13-2009, 09:10 PM
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:rolleyes:]

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

See here (http://demos.theactivegroup.com/demodesk.html?demo=mif&script=treenav) 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?

Snookerman
12-13-2009, 09:48 PM
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 (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.

jscheuer1
12-14-2009, 09:30 AM
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.