做登录界面的时候发现有时候点击登录按钮页面无响应,要重新加载一遍网页证书才能登录,请问这有什么好的解决办法吗?网上有人说网络太差也会出现这样的情况var validate2 = $("#form2").validate({ /*自定义验证规则*/ debug: true, rules: { username: { required: true, }, password: { required: true, }, }, messages: { username: { required: '请输入用户名', }, password: { required: '请输入密码', } }, errorPlacement: function (error, element) { error.appendTo(element.parent().next()); }, submitHandler: function (form) { var userName = $("[name|='username']").val(); var passWord = $("[name|='password']").val(); loginByUserName(userName, passWord); } });...部分删减 太长了function loginByUserName(userName, passWord) { loginMagByUserName.param.userNameOrPhone = userName; loginMagByUserName.param.password = passWord; $.postJSON("LoginByPassword", loginMagByUserName, function (ajaxData) { if (ajaxData.head.code === "C2000") { localStorage.token = ajaxData.head.token; location.href="main.html" } else { $("#error2").append("<label class='error'>用户名或密码错误</label>"); } }); }
添加回答
举报
0/150
提交
取消