Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 7th, 2003, 01:26 AM
Authorized User
 
Join Date: Jun 2003
Location: , , USA.
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
Reply With Quote
  #2 (permalink)  
Old August 7th, 2003, 03:31 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
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
Reply With Quote
  #3 (permalink)  
Old August 7th, 2003, 02:15 PM
Authorized User
 
Join Date: Jun 2003
Location: , , USA.
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:15 PM.


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