$(‘.input’).keypress(function (e) {
if (e.which == 13) {
$(‘form#login’).submit();
return false; //<---- Add this line
}
});
本质上,“ return false”与调用
e.preventDefault和相同
e.stopPropagation()。

$(‘.input’).keypress(function (e) {
if (e.which == 13) {
$(‘form#login’).submit();
return false; //<---- Add this line
}
});
本质上,“ return false”与调用
e.preventDefault和相同
e.stopPropagation()。