I have a click event that will not return false after I have called my ajax function i was wondering how I can get around this. I have used e.preventDefault() which works so that the url doesn’t add a hash but when I use return false after my ajax function it doens’t work but If I do it the other way round it works but cancels out my ajax call.
<a href="#">Click me</a>
$('a').click(function(e) {
getProducts(..., ...., ....) //my ajax function
e.preventDefault() // doesn't work
return false; doesn't work either
});
cancel the default action using
preventDefaultfunction.