Wrox Programmer Forums
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 7th, 2003, 01:26 AM
Authorized User
 
Join Date: Jun 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to natmaster Send a message via AIM to natmaster Send a message via MSN to natmaster
Default Navigation Scrip

well i have my site set up so that the navigation bar is a bunch of table cells with text inside them (visit the website below to see what i mean) and so if you press on the table, the link will load. but i kept a normal textual link (with the <a> tag) for older browsers and crawlers. so if they press the text, they actually activate the link twice (the normal link and the javascript both trigger). normally this is fine, because i have them load the page within my frames.

the problem is that i recently found a free forum place and i don't have the time nor the resources to make and host my own forum. SO i signed up and put a link on my page on this navigation stuff that will open it in a new window (the main problem in opening in my frames is that i cannot modify the theme because of the forum because i'm using the free one and the white background and all looks horrible within my frames). so i make my <a> tag target _blank to open a new window....then i get to the javascript.........

when the table cell is pressed, it activates a script that opens a new window. but if you press the text, it will open two windows....not good for the user.

i need someway of either stopping the javascript request if the text is click (namely some kind of function triggered from <a onClick="func();">) OR a function with the same trigger that closes the javascript window i opened.

any suggestions?
thanks in advance.

----------------------------
http://aeonofdarkness.com
__________________
----------------------------
Aeon of Darkness MUD - Free Online Roleplaying Game
http://aeonofdarkness.com
 
Old August 7th, 2003, 03:31 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

If you return false after onclick the normal behaviour is over-ridden:
Code:
onclick="myFunc();return false;"
or have "myFunc" return false and you can keep your original HTML.

--

Joe
 
Old August 7th, 2003, 02:15 PM
Authorized User
 
Join Date: Jun 2003
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to natmaster Send a message via AIM to natmaster Send a message via MSN to natmaster
Default

wow, that's a lot easier than i thought it would be, thx

----------------------------
http://aeonofdarkness.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Navigation sg48 ASP.NET 2.0 Basics 2 February 13th, 2008 12:18 PM
Navigation volsha Dreamweaver (all versions) 1 July 20th, 2007 03:19 PM
navigation nidheeshkayal ASP.NET 2.0 Basics 0 March 16th, 2006 07:05 AM
Page Navigation surendran PHP How-To 1 August 2nd, 2004 12:57 PM
Navigation JonnyRPI HTML Code Clinic 1 July 6th, 2003 05:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.