$("a.avatar").click(function(e){
e.preventDefault();
$("#thumbnails").fadeIn();
});
and
$("a.avatar").click(function(e){
$("#thumbnails").fadeIn();
return false;
});
Both can achieve the same goal for me.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Returning
falsefrom jQuery event handlers is equivalent to calling both,e.preventDefaultande.stopPropagation.So the difference is that
preventDefaultwill only prevent the default event action to occur, i.e. a page redirect on a link click, a form submission, etc. andreturn falsewill also stop the event flow.