Internet Explorer JavaScript Links

by Nate on January 9, 2009

Using <a href=””></a> links to call JavaScript functions can be a bit trickier than you might think. The issues that I’ve run into are generally Internet Explorer-specific (aren’t they all?). While troubleshooting these issues, I’ve discovered a syntax that seems to solve all of the problems:

<a href=”javascript:void(0)” onclick=”yourFunction();return false”>Click Here</a>

Hopefully this helps someone.

{ 6 comments… read them below or add one }

Harry M June 30, 2009 at 8:14 am

You helped immensely. Of course issue with IE in a video center trigger and it was adding the # and not just once but repeatedly appending it on tabs and in the title. You little help made it clear right up…thanks.

Reply

Rainer January 21, 2010 at 9:19 am

Worked perfectly.Thanks a lot!

Reply

Chris Bailey February 8, 2010 at 11:21 am

Can you explain how it works? and it did work for me too.

Reply

JED June 29, 2010 at 12:33 pm

Thanks!

Reply

Javier September 18, 2011 at 5:23 pm

Its great!, thanks.

Reply

Marcelo October 7, 2011 at 3:34 am

Very helpful, THANKS!!!

Reply

Leave a Comment

{ 1 trackback }

Previous post:

Next post: