PDA

View Full Version : open external page link in other page's iFrame



Gabber
12-12-2004, 06:29 AM
I have a indexframe.htm in which I have an Iframe called "MainFrame". The scr="main.htm" , so this is the first page opened inside the iframe.

now I want from an external page to open forum.htm inside the Iframe in indexframe.htm ("MainFrame").

how do I do this?

cr3ative
12-12-2004, 08:00 AM
<a href="forum.htm" target="MainFrame">Forum</a>

Should work.

cr3ative

Gabber
12-12-2004, 03:54 PM
lol that would be too easy... you don't understand what I mean!

Imagine I want forum.htm to open in the iframe of index.htm from a link posted in this forum!

get my point? an outside link!

cr3ative
12-12-2004, 04:03 PM
Ooh. Complicated.
Sorry I can't help any further.

Merry Christmas
cr3ative

Gabber
12-12-2004, 04:52 PM
thanx. Merry Xmas to you too...
do you know someone who can help me out?

ddadmin
12-15-2004, 12:08 PM
lol that would be too easy... you don't understand what I mean!

Imagine I want forum.htm to open in the iframe of index.htm from a link posted in this forum!

get my point? an outside link!

Well, it would only work if the link appears in the page containing the iframe as well. Otherwise, no, you can't have a link on another page load its page into an iframe. For the former, you can basically get to an iframe using the javascript code:

document.getElementById("MainFrame").src="newpage.htm"

Gabber
12-17-2004, 12:20 AM
sorry for the n00bity, but I don't get it... let's say I have a forum.htm link in the page that has the iframe.
and I want from an external page (or javascript code within the page) to make to user go the the iframe page and open forum.htm in the iframe...

get my point?
now where do I place the line of code you have gave me?

greetz

ps: thank you for the time :)

ddadmin
12-17-2004, 01:12 AM
Your link will then look something like:

<a href="javascript:document.getElementById('MainFrame').src='newpage.htm'">Click here</a>

Again, this assumes the link is in the same page as where the Iframe is.