• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

iFrame link

Should be simple issue here, but cant find out what Im doing wrong!

Ive got a simple iframe which when the user click on a link, the iframe changes to that.

Using a frame is easy, and I thought that iFrame is the same, but obviously not.

Any ideas where Im going wrong here?
<a href="http://www.google.co.uk" target="ifraBody">google</a><br />
<a href="http://www.bbc.co.uk" target="ifraBody">bbc</a><br />
<a href="http://www.hotmail.co.uk" target="ifraBody">hotmail</a><br />
<div id="divBody">
	<iframe id="ifraBody" src="body.php"></iframe> 

Open in new window

2 Solutions
i don't know if you can use iframes as a normal frame....

but i guess you could use onclick event and write

<a href="http://www.bbc.co.uk" onclick="    document.getElementById('ifraBody').src = this.href;    ">bbc</a><br />

or something similar....
Roger BaklundCommented:
Try this:
<iframe id="ifraBody" name="ifraBody" src="body.php">

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now