There's a few different ways people create links to javascript function, after some looking around here's what seems to be the better ways:
CODE
<a href="java script:{}" onclick="foo()">Call it</a>
<a href="java script:;" onclick="foo()">Call it</a>
<a href="java script:void(0);" onclick="foo()">Call it</a>
<a href="#" onclick="foo(); return false">Call it</a>
And many people will say to back it up with a server-side page or needs-JS page like:
CODE
<a href="jsrequired.html" onclick="foo(); return false">Call it</a>
|
Team Leader
|
![]() |
| 20Sep2007,10:40 | #2 |
|
onClick is the most popular way to link to JavaScript calls, people sometimes link this way too..
Code: HTML
|
|
Go4Expert Member
|
|
| 21Sep2007,20:40 | #3 |
|
Quote:
Originally Posted by pradeep Gratz for completing me!!! |

