homepage Welcome to WebmasterWorld Guest from 54.166.173.147
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / WebmasterWorld / New To Web Development
Forum Library, Charter, Moderators: brotherhood of lan & mack

New To Web Development Forum

    
How can I open a link in an iframe?
wiredgear




msg:968642
 10:14 pm on Mar 30, 2003 (gmt 0)

I am sorry for the noob question. :( I've been trying to figure this out and I just can't.

I have a menu for my new website design where you can choose a link to open a page. But I want these links to be opened in a iframe. Since I am horrible in english a bit, maybe a picture can tell you more of what I mean. <snip>

I am using Dreamweaver MX for the coding etc.

can someone help me out?

[edited by: Woz at 1:52 am (utc) on Mar. 31, 2003]
[edit reason] No URLs please [/edit]

 

felix




msg:968643
 11:29 pm on Mar 30, 2003 (gmt 0)

I can't help you with dreamweaver, but I can show you the javascript. You will need something like this...

function show() {
document.getElementById('frame1').src="http://www.foo.com/"
}

...

<a href="javascript:show()">This opens www.foo.com in the iframe.</a>
<iframe id="frame1">Your browser does not support iframes. Too bad for you.</iframe>

This will work for DOM compliant browsers. Older and non-compiant browsers need to be handled individually as usual...

My best advice? I know you didn't ask, but I'm going to say it anyway. WYSIWYG tools are most useful when used together with a good understanding of the underlying code.

wiredgear




msg:968644
 1:08 am on Mar 31, 2003 (gmt 0)

hey thx for the help but I have no idea what to do with the javascript. Where do I put it? As you can see, I am a html noob.

MWpro




msg:968645
 1:40 am on Mar 31, 2003 (gmt 0)

Felix, what is the point of making things complicated with javascript? Especially for a beginner who is just asking for help...

Just give it a name or id, and use the target attribute within the <a href code.

example

<iframe name="namehere"....

<a href="linkhere.html" target="namehere">Link Text</a>

wiredgear




msg:968646
 2:32 am on Mar 31, 2003 (gmt 0)

MWpro, thank you very much! I've been trying to do this for a while now. I really appreciate the help guys. Again, thx.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / New To Web Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved