PDA

View Full Version : Simple I-frame opening question


Jmehl84
11-01-2002, 09:06 PM
I'm relatively new to Javascript.. this is just some basic code I'm having trouble making work.. I'm much for familiar with C++, and as such I'm inclined to try C++ code and syntax :)

What I am trying to do is have one link open two seperate IFrames, with different hrefs:

<script>
function twoForOne(var mainLink, var titleLink)
{
parent.mainFrame.location=mainLink
parent.titleFrame.location=titleLink
}
</script>

and then, in context:

<a onclick="twoForOne("main.html","maintitle.html")">

If anyone could tell me whats wrong with this code it would be much appreciated. Also, if there is some way in which I could do this AND keep my <a href> CSS settings - that would be great.

Thanks,

Jeff

bcbasslet
11-01-2002, 09:22 PM
easy
<p><a target="rtop" href="nav_top.htm" title="Return to Rene and Akol's Home Page"
onClick="parent.rbottom.location='Page1.htm'">
<img border="0" src="eng2.jpg" width="87" height="110" ></a></p>

you do it win an <a target = and an onClick within the same a tag.

this i learned from a chapter in the tutorials at javascriptkit.com.
loaded with great stuff.

Jmehl84
11-01-2002, 09:27 PM
Awesome, thanks for the help.

-Jeff