• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 308
  • Last Modified:

Any drawbacks to this construction: <ahref="" onClick="JSfunction();return false;" as a substitute for javascript:

Dear Experts

Are their any drawbacks to this construction: <a href="" onClick="JSfunction();return false;" as a substitute for javascript:httpp//...

Assume IE5+ and Moz/Firefox/NS 7+ browsers with no concern about JS being off.

Thanks.
0
metalaureate
Asked:
metalaureate
  • 3
1 Solution
 
knightEknightCommented:
actually, that is prefered.  As long as you remember to return false from the onclick, the advantage is that you can put anything you want in the href and it will be ignored:

<a href="Click Here!" onClick="JSfunction();return false;" >click</a>

(the href shows up in the status bar)
0
 
knightEknightCommented:
short answer: no drawbacks as compared to  href="javascript:JSfunction"
0
 
knightEknightCommented:
(which looks ugly in the status bar)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now