I am implementing a floating pop-up help control in an asp.net web site, and i'm using JQuery to implement the whizzy bits.
The pop up is made visible by clicking on a link, the link also has an href poining to another page to support users with JavaScript disabled. I added "return false;" to the end of the Javascript string in the onClick event of the link, to prevent Navigation to the href value, and was very happy until I realised that this is not supported in Firefox.
I've come across several articles pointing to the event.preventDefault method that can be used to get Firefox to behave in the same way, but in all cases the example involved seems to have some onerous pattern of explicitly adding events to the object concerned.
Is there a simple way to get this kind of syntax to work? I want to keep my control as simple as possible. Code example:
<a id="myLink"
onclick="javascript:$('#myPanel').addClass('helpPopOn');return
false;" href="/pages/help.aspx?content=TestHelp">Help</a>