iFrames in Dreamweaver CS3

philnolan3d

New Member
I finally figured out how to add and edit iFrames. But it's been a long time since I worked with them Is there a way to click a link on the main page and change the content in the iFrame?
 

jnjc

New Member
<body>
<a href="http://www.nofuss.com.au"
onclick="document.getElementById('test1').src=this.href;return false">test</a>

<iframe id="test1" src="" height=50% width=50%></iframe>

</body>



HTH,
JC
 

joe

New Member
Or you could have used target=framename. Not sure how "compliant" that is, but it saves a bit of typing time.
 

philnolan3d

New Member
Or you could have used target=framename. Not sure how "compliant" that is, but it saves a bit of typing time.

That's actually what I was thinking it might be. But oh well, as long as I've got it typed in once it's essentially copy/paste from there.
 

jnjc

New Member
Or you could have used target=framename. Not sure how "compliant" that is, but it saves a bit of typing time.

I don't think you are right. As far as I know "target" only works with framesets not iframes....
 

jnjc

New Member
I did try it and it opens a new window when you click the link, can you post an example ?
 

joe

New Member
This should work.

<a href="http://www.whatever.com" target="frame1">Click Here</a>
<iframe name="frame1" src="somethingelse.com"></iframe>
 

jnjc

New Member
I stand corrected, it does work and it is a much better way of doing it then the method I suggested.

The reason it wasn't working for me is because I used an 'id' on the iframe whereas I should have used 'name'.


Thanks,
JC
 

joe

New Member
yeah....I'm not that knowledgeable with javascript, just know how to manipulate it to work for me, so that's how I found the target attribute that does the trick for iframes.
 
Top