J.J.Baxter - My place on the web - interests, hobbies, thoughts & ruminations
Home / Blog
Books
Links
Images
Aug Sep-2010 Oct
SMTWTFS
2930311234
567891011
12131415161718
19202122232425
262728293012
3 4 5 6 7 8 9
Reset Calendar
Snorg Girls
Programming Tips
Sherlock Holmes
Mythbusters
Gallipoli
Nova Science Now
Ajax Loading Images
The Girls of Dr. Who
Keratosis Pilaris (KP)
Amazing Water
Buy me a drink? I'll have a Cappuccino, thanks.
Random Images
Random Link
Boing Boing
Random Book
The Clan of the Cave Bear
by Jean M. Auel






All Rights Reserved 2008
JJBaxter.com

J.J.Baxters Development Tips & Snippets
backBack
 Javascript:; doesnt work!!! (JavaScript : 04-Jul-2007)
This was one of those bugs that seems to defy explanation

I had an anchor tag like this

<a href="javascript:;" onClick="checkdata()">Next</a>

and it worked just fine. The checkdata() code verified that all the fields were filled in and ended with a document.forms["form1"].submit(); to submit the form. Worked fine for months if not years. Then suddenly I started receiving reports that users would click "Next" and nothing would happen? The checkdata() code was executing but the submit() wouldnt submit the form. After discovering that the users were using IE6 and starting a virtual PC session with IE6 I was able to replicate the problem! I Googled and found the solution at the link below. Changed the link to :

<a href="#" onClick="checkdata();return false;">Next</a>

and it now works. I dont know why the original method worked before, I assume a recently issued patch from Microsoft changed the behaviour of javascript:; in some way.

Frustrating.
Ref Link: http://blog.reindel.com/2006/08/11/a-hrefjavascriptvoid0-avoid-the-void/