Link to iFrame 'takes over' the page?!

Weird, the first time I experience this: I make an iFrame and link it to a website. But when the website loads in the iFrame, the website ‘takes over’ and ‘pushes away’ the rest of my own created page. It literally takes over and neglects the whole designed page. Anything we can do about this?

Paul


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

No. The page you are framing in is using the old trick of testing to
see if it is “top”, and “busting” your frame if it isn’t.

They are telling you explicitly that they do not want to be framed in.

This trick was invented about 20 minutes after Frames were, in the
days when Netscape 2 was the only browser people cared about supporting.

if(self.location.href != top.location.href) top.location.href =  

self.location.href;

Walter

On May 27, 2009, at 10:01 AM, paulvw wrote:

Weird, the first time I experience this: I make an iFrame and link
it to a website. But when the website loads in the iFrame, the
website ‘takes over’ and ‘pushes away’ the rest of my own created
page. It literally takes over and neglects the whole designed page.
Anything we can do about this?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hmmm… an old trick… from before my time :wink:
OK, that means I can’t do anything with that link. Too bad.

Paul


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

If you’re bound and determined to “scrape” someone else’s page, you
can, but not with Frames (whether i- or the older-school capital-F
Frames). The following PHP will (if your server is configured to allow
this) “suck” the contents of a remote page into a text variable.
Further processing will make it safe to insert into your page (you
have to clip off everything except the contents of the body tag). Note
that this process of removing the head will destroy any JavaScript or
CSS in the original page, so what you end up with will be essentially
un-styled, normally behaved text. This may or may not be worth it,
from your perspective. Consider using a link to the page in question,
perhaps set to pop up in a new window.

//up in the before html part of your page, in a php block
$page = file_get_contents('http://www.example.com');
$regex = '/<body[^>]+>([sS]+?)</body>/';
$page = preg_replace($regex,"$1",$page);
//end of php block
//further down in your page, where you want the page to appear
<?=$page?>

Walter

On May 27, 2009, at 10:15 AM, paulvw wrote:

Hmmm… an old trick… from before my time :wink:
OK, that means I can’t do anything with that link. Too bad.

Paul


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Indeed Walter, pop up window would be an option then. I want all the scripts to stay on the original page.

Thanks - good to learn about the old school.

Paul


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options