Forum Moderators: open

Message Too Old, No Replies

iframe

iframe content change

         

shanerichey

12:20 am on May 7, 2003 (gmt 0)

10+ Year Member



ive searched this forum and havent been able to locate the answer to my question, so if this post is redundant, i apologize.

ok, my question is this: on my "index.html" i have an iframe that diplays "content.html". how would i buld a link on my index.html that changes the content in my iframe.

i immagine that i would have to name the table that contains the iframe and point to that in the link, but so far i have been unable to do this successfully.

thanks in advance for any help.

SinclairUser

12:29 am on May 7, 2003 (gmt 0)

10+ Year Member



Can you be a bit more specific - the answer may be a simple one - but I dont really understand the question.

asidonline

12:33 am on May 7, 2003 (gmt 0)

10+ Year Member



iframes support the 'name' attribute, just like normal frames.

give your iframe a name (eg name="DisplayArea")

Create a link in your main page that uses DisplayArea as the target.

eg <a href="moreinfo.htm" target="DisplayArea">Click here for more info!</a>

Careful - I think the iframe name is case sensitive.

Antony

shanerichey

12:41 am on May 7, 2003 (gmt 0)

10+ Year Member



i was having trouble tyring to target the link on index.html to the iframe. i knew it was a simple problem.

ive got it figured out now...i new as soon as i asked someone i would find the problem...and i did..

now ive got an additional question. is there any way to make one link change the content in two seperate iframes at one time.

for instance. on my index page i have two i frames, one contains a subnavigation, and the other contains content. i would like for a link on my index page to change the content in both the subnav iframe as well as the content iframe. is this possible?

hope this is a little more understandable.

again, thanks in advance

SinclairUser

12:46 am on May 7, 2003 (gmt 0)

10+ Year Member



You can use javascript to update two frames at once.

asidonline

1:52 am on May 7, 2003 (gmt 0)

10+ Year Member



Untested, but i think this works.

<iframe name = "DisplayArea"...

<iframe name = "SubNavArea"...

<a href="moreinfo.htm" target="DisplayArea" onclick="SubNavArea.location.href='detailsubnav.htm'">Click here to update two iframes at once!</a>