我不知道如何解决此错误,我的按钮不起作用。用户登录并按按钮后,聊天必须打开
JQuery(function($) {
$(document.forms['login-form']).on('submit', function() {
form = $(this);
$('.error', form).html('');
$(":submit", form).button("loading");
$.ajax({
url: "/login",
method: "POST",
data: form.serialize(),
success: function() {
$(":submit", form).button("reset");
},
statusCode: {
200: function() {
form.html("login").addClass('alert-success');
window.location.href = "/chat";
},
403: function(jqXHR) {
error = JSON.parse(jqXHR.responseText);
$('.error', form).html(error.message);
}
}
});
return false;
});
});