Como você sabe quando retornar false de uma função jQuery?
"return false
"parece funcionar nasubmitHandler
mas não tenho certeza do porquê.
function submitHandler() {
$.post($(this).attr('action'), $(this).serialize(), null, "script");
return false;
}
$(document).ready(function () {
$('#top_cat').submit(submitHandler);
$("#tip_click").click(function() {
$("#high_hat").submit(submitHandler);
});
});
Eu também não tenho certeza se preciso adicionar um "return false
" no#tip_click
função para que ele leia assim:
$("#tip_click").click(function() {
$("#high_hat").submit(submitHandler);
return false;
});
Qual é a regra a seguir aqui sobre quando "return false
"?