ID是否
#loginForm指向表单?如果是,则需要侦听Submit事件而不是单击click。如果您确实需要监听click事件,则必须将事件绑定到Submit按钮或触发的任何事件
form.submit()。
尝试这样的事情:
$('#loginForm').on('submit', function(e) { e.preventDefault(); e.stopPropagation(); // only neccessary if something above is listening to the (default-)event too [YOUR CODE GOES HERE]});这应该为您解决问题。



