PDA

View Full Version : Frames and Target Syntax


Book38
01-02-2003, 10:52 PM
I'm new to JavaScript but not affraid to try.

I am using buttons created in Javascript on my website and I need to use frames on 3 pages. When you click on any of the buttons you are supposed to go to a different page. But if I click on the button in a frameset to go elsewhere, the page opens up in that same frame.

How do you get javascript to let you click on a link and open an entirely new page? There must be some syntax I am missing.

Here is the code for one of the buttons:

<input type="button" name="Button" class="thisclass" value="Greetings " onMouseOver="this.style.color='#000000'" onMouseOut="this.style.color='#000000'" onMouseDown="this.style.color='#000000'" style="color:#000000; font-family:Algerian; font-weight:none; font-size:10px;" onClick="jumpto2('<a href"http://something4me.com/greets.html" target=_top')">

I know this is the wrong syntax as it does not work. If I take out the href and target tags it just opens up in the same window as the link clicked.

I have exausted myself trying to find a simple answer to a very simple problem.

beetle
01-02-2003, 11:00 PM
onClick="top.location.href='http://something4me.com/greets.html';"

whammy
01-03-2003, 01:20 AM
I love the fact that you said "not afraid to try". You will be an experienced programmer in NO time with that attitude. Don't forget that a computer (or programs) only understand what instructions you give them. You are totally on the right track, just play around with stuff until it works (as beetle's example should). :)

Book38
01-04-2003, 07:03 PM
Thanks to both Beetle and Whammy- - I will try your suggestion Beetle. I am useing a Flash script at the moment, but sometimes it does not load.

I need immediate navigation for anyone comming to the site. I will use beetle's suggestion and create a javascript for all the navigation button's on the site.

Whammy, thank you so much for the incuragement!! New to programming in Javascript, I need all the pat's on the back I can get.

Thank you both again, and I will let you know how it works out.