html - Using the <a> tag as a button without following its link -


I & lt; A & gt; I use javascript to implement behavior.

How can I prevent the browser from following the link while executing all the click () events?

This:

  $ ("a.button"). Live ("click", function (event) {return false;});  

does not work, because, depending on the condition of that handler, it can prevent other .click () executors from executing. For some buttons this works as I want, but for some it prevents me from executing my other handlers.

I know that I can use a button to click on a button, but I call it AOP-path.

jQuery provides a method that will stop the event's default action from the event. Following this, the link will be stopped by following the following code, but other operators also should not stop the promotion

  $ ("a.button"). Click (function (event) {event.preventDefault ();});  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -