Click to See Complete Forum and Search --> : Working with iFrames


scottyrob
11-19-2005, 07:23 AM
Hi
I have a basic page with a links table on the left and in the middle of the page as iframe.. this is the only code the iframe has <iframe> </iframe> how do i make it so that when i click on a link on the left, the text shows up in the iframe?

Fet

Fang
11-19-2005, 08:00 AM
<a href="aPage.htm" onclick="document.getElementsByTagName('iframe')[0].src=this.href; return false;">link</a>

Charles
11-19-2005, 08:31 AM
You would do better to change that IFRAME element a little bit:<iframe src="" name="myframe"></iframe>

<a href="http://www.w3.org" target="myframe">W3C</a>

Fang
11-19-2005, 09:00 AM
You would do better to change that IFRAME element a little bit ... If you use a Transitional DTD, although the W3C recommends Strict.

Charles
11-19-2005, 11:12 AM
If we're using the IFRAME element then we're already using the transitional DTD.