I am trying to use $ (). live to improve the site, but he insists on the next href. The following is very close to the real code (a.class, span inside a).
<a class="test" href="http://google.com"><span>test</span></a>
$('a.test').live('click', function(event){
event.preventDefault();
$(this).text('clicked');
});
Testing this in jsfiddle works , but not when I use it in my project. The handler starts, but href also executes. I tried and return false and event.preventDefault () with the same result.
Try so that I can not find anything that could interfere with the work on my site.
So my question is should this ever work? If so, is there something that could not do this?
source
share