Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Href attribute for JavaScript links: "#" or "javascript:void(0)"?
Href attribute for JavaScript links: "#" or "javascript:void(0)"? [message #1057728] Wed, 08 May 2013 13:26 Go to next message
Hi-Tech ITO is currently offline Hi-Tech ITOFriend
Messages: 2
Registered: May 2013
Location: Ahmedabad
Junior Member
When building a link that has the sole purpose to run JavaScript code, there are 2 ways to write the code. Which is better, in terms of functionality, page load speed, validation purposes, etc?

<a href="#" onclick="myJsFunc();">Run JavaScript Code</a>

or

<a href="javascript:void(0)" onclick="myJsFunc();">Run JavaScript Code</a>

Re: Href attribute for JavaScript links: "#" or "javascript:void(0)"? [message #1057762 is a reply to message #1057728] Wed, 08 May 2013 15:33 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
Web questions need to be asked on the Web Tools forums. This is the Eclipse Java Development Tools forum.
Previous Topic:Non Dynamic project to sent string to another pc
Next Topic:overlaps the workspace location
Goto Forum:
  


Current Time: Thu Apr 25 07:42:08 GMT 2024

Powered by FUDForum. Page generated in 0.03106 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top