Topic awaiting preservation: Anchor Tag - onclick event w/no parent window refresh |
|
---|---|
Author | Thread |
Bipolar (III) Inmate From: Phoenix |
posted 11-14-2004 19:01
Hello, |
Paranoid (IV) Mad Librarian From: Berlin |
posted 11-14-2004 19:20
Give this a try: code: <a href="javascript:void(0);" onclick="promoteevent();">- Click Here For More Information -</a>
code: <a href="javascript:promoteevent();">- Click Here For More Information -</a> |
Bipolar (III) Inmate From: Phoenix |
posted 11-14-2004 20:08
Hey that works! For some reason, I was under the impression that "return 0;" was sufficient in the onclick event or that you could do something like "return(promoteevent()); where promoteevent() always returned 0. |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 11-14-2004 20:10 |
Bipolar (III) Inmate From: Umeå, Sweden |
posted 11-14-2004 20:18
For compatibility the check for the return value to cancel a default action is strict. It must be the false value and nothing else. The reason is that the default value of a function return is undefined, which autocasts to false, and thus they couldn't allow autocasting since that would mean any function that doesn't return a value cancels the default event. |
Paranoid (IV) Inmate From: France |
posted 11-14-2004 20:44 |