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.
{ 1 trackback }
{ 3 comments… read them below or add one }
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.
Worked perfectly.Thanks a lot!
Can you explain how it works? and it did work for me too.