[Javascript] href vs onclick

Anthony Webster Anthonywebster at venda.com
Tue Oct 8 05:32:22 CDT 2002


hi peter,

yes it was in 5.0 and the link was inside a form.

thanks for your help,

anthony

-----Original Message-----
From: Peter-Paul Koch [mailto:gassinaumasis at hotmail.com]
Sent: 08 October 2002 11:30
To: javascript at LaTech.edu
Subject: Re: [Javascript] href vs onclick





>I always used to call my scripts like this:
><a href="#" onclick="myFunction();">click here</a>
>
>but have recently found this is causing problems with IE5

5.0 (as opposed to 5.5)?

>the workaround has been to do this:
><a href="javascript:myFunction();">click here</a>
>
>is this the correct way to call scripts or are both methods acceptable?
>
>just wondering if I've been doing things wrong all this time,

There's a bug in IE 5.0 that requires you to use <a href="javascript:etc"> 
when submitting a form through JavaScript. The onClick simply won't work. 
But I've never seen this bug creep up in other circumstances.

In any case it's solved in IE 5.5

ppk

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com

_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript



More information about the Javascript mailing list