function checkusername() { var username = document.getElementById("username").value; var regEmpty = /\S/; if (!regEmpty.test(username)) { setErrorMessage("用户名为空!"); return false; } return true; } function checkpassword() { var err=""; var password=document.getElementById("password").value; if(password=="") { err+="密码不能为空"; } if(err!="") { document.getElementById("spanpassword").style.display=""; document.getElementById("spanpassword").innerHTML=err; return false; } else { document.getElementById("spanpassword").style.display="none"; return true; } } function response(data) { $("#service").val(data.Service) $("#justone").val(data.Ticket) } function xsrf(data) { $("#xsrf").val(data) } function createIFrame(frameName, src) { if (src == null) src = "javascript:false;"; jQuery("iframe[name='"+frameName+"']").remove(); var frame = document.createElement('iframe'); frame.height = 0; frame.width = 0; frame.style.display = 'none'; frame.name = frameName; frame.id = frameName; frame.src = src; jQuery(document.body).append(frame); }; function checkSubmit() { if (!checkUserName()) return false; if (!checkPassword()) return false; // createIFrame("loginiframe"); // $("#loginform").attr("target", "loginiframe"); return true; } function callbackFun(param) { var r = parseInt(param.reason); switch (r) { case 0: setErrorMessage("验证码错误"); break; case 1: setErrorMessage("登录名不能为空"); break; case 2: setErrorMessage("密码不能为空"); break; case 3: setErrorMessage("帐号未激活,点此激活"); break; case 4: setErrorMessage("帐号或密码错误"); break; case 5: setErrorMessage("帐号已经被锁定"); break; case 6: setErrorMessage("页面超时"); break; case 7: if (param.url == "") window.location.href = "/"; else window.location.href = param.url; break; } } (function () { document.write('<\/script>'); document.write('<\/script>'); document.write('<\/script>'); })();