Click to See Complete Forum and Search --> : iFrame mix with Javascript question
PixieX
04-30-2006, 11:57 PM
Hi, I recently posted a board on the HTML section: http://www.webdeveloper.com/forum/showthread.php?p=561251#post561251
And was told that the second part of the iFrame that I thought could be possible would be better with a javascript (or better) What type of javascript would I be using? I'd like to try to look it up instead of having anyone type in the codes or anything. Thank you for reading.
phpnovice
05-01-2006, 09:18 PM
The "or better" part refers to using server-side code *instead* of JavaScript.
What does the HTML for your sublinks look like?
...and where is the linked content to appear?
PixieX
05-01-2006, 09:38 PM
The "or better" part refers to using server-side code *instead* of JavaScript. What does the HTML for your sublinks look like?
...and where is the linked content to appear?
Sorry, I don't understand what server-side code means. The HTML for my sublinks would appear as standard text link. For example, if you click on the Guild link, the list of sublinks would appear in the sublink section. When you click on any of the sublinks, the information about that sublink would appear in the the huge grey content area on the left side.
The right side would be a chatterbox.
phpnovice
05-01-2006, 09:43 PM
If you make the left side as an IFRAME, then you would use something like this for a sublink:
<a href="...some.url..." target="otherIframeName" onclick="
parent.frames[this.target].location.href = this.href;
return false;">link text</a>
PixieX
05-01-2006, 09:48 PM
Wow that sounds really confusing, and for a moments thought I wanted to give up and remake my layout. However, you have been kind enough to help me, so I will try your suggestion. Thank you so much!
phpnovice
05-01-2006, 10:10 PM
Actually, I just tested it and found that you don't need any JavaScript at all for your sublinks. Links in one IFRAME can directly target another IFRAME in the same parent document -- just by using the target attribute and specifying the name of the other IFRAME.
PixieX
05-01-2006, 10:17 PM
I'm sorry iFrames confuse me a whole lot, but I'd like to learn it to the point where I can understand it. I apoligize in advance if I am a nuisance. If I put it this way... where my sublinks are one iFrame and my main content is another iFrame, do you mean I can connect the links in my first iFrame to my content iFrame? Would my imagemap also be considered within an iFrame because I am directing all my sublinks of the imagemap links in the sublink iFrame?
phpnovice
05-01-2006, 10:20 PM
Keep your AREA tags as I showed you in your other post. They load your sublinks document into the first IFRAME. Then, just code your sublinks similar to this:
<a href="...some.url..." target="secondIframeName">link text</a>
PixieX
05-01-2006, 10:23 PM
Okay, and the secondiFramename would link to my main content then?
phpnovice
05-01-2006, 10:25 PM
That references the name of a second IFRAME where your main content would end up, yes. The first IFRAME is where your sublinks would load.
PixieX
05-01-2006, 10:28 PM
Okay, I think I have a general understanding now. Thank you for clearing it up for me! If I have any additional problems, I will come back to this post. Again, thank you for your time.
phpnovice
05-01-2006, 10:30 PM
Your other post would be more appropriate -- since there is no JavaScript involved here.