0

Good afternoon,

I was wondering if anyone knows of a way to force a page that always wants to open in a new window to open in an iframe?

I have several links on the same page with an iframe to the side, and i would like it for the pages to open in the iframe without ever leaving the main page, so the user could click a link and the page would appear, and the links are still on the side to be able to click a different one. I have it working right now on most pages, but there are a few pages (which i cannot modify the code) that are opening in new windows, and was curious if there was a way to force it into the frame? Or is there another better method of going about doing this?

Thanks in advance!

Rob

5
Contributors
4
Replies
8
Views
7 Years
Discussion Span
Last Post by kishancg
0

Hello Rob!

If you would like all links in a given section of your document to open in the iframe (unless specified otherwise through a 'target=...' in the '<a ...>' tag), you can use the <base target='theFrame'>...</base> tags. For example:

iframtest.php

<html><body><center>
<base target="theFrame">

<a href="http://www.facebook.com">Click here for facebook in the iframe</a><br /><br />

<iframe width="500" height="500" src="http://www.google.com" name="theFrame"></iframe>
</center></body></html>

More generally, to ensure that a clicked link opens in an iframe, two things must be set: the name of the iframe and the target of the link. Here is an example:

<html><body><center>

<a href="http://www.facebook.com" target="theFrame">Click here for facebook in the iframe</a><br /><br />

<iframe width="500" height="500" src="http://www.google.com" name="theFrame"></iframe>
</center></body></html>

Note that the targets in the link/base tags and the name of the iframe are the same.

Warm regards and best of luck in your project,
Sam

Good afternoon,

I was wondering if anyone knows of a way to force a page that always wants to open in a new window to open in an iframe?

I have several links on the same page with an iframe to the side, and i would like it for the pages to open in the iframe without ever leaving the main page, so the user could click a link and the page would appear, and the links are still on the side to be able to click a different one. I have it working right now on most pages, but there are a few pages (which i cannot modify the code) that are opening in new windows, and was curious if there was a way to force it into the frame? Or is there another better method of going about doing this?

Thanks in advance!

Rob

Edited by sweisern: n/a

0

i cant open a link--example--i click on a email from jobs.com-it list jobs as a manager-says view discp-i click it and it dont open.-any one know why?

0

i cant open a link--example--i click on a email from jobs.com-it list jobs as a manager-says view discp-i click it and it dont open.-any one know why?

Dont hijack other peoples threads
start your own

try turn off your pop up blocker(or hold whatever key combination) if the links are configured to open in new windows

0

Here you using href..
<a href="http://www.facebook.com" target="theFrame">Click here for facebook in the iframe</a><br /><br />
How to the with "button". I mean the click of a should redirect to iframe with a url.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.