function checklogin(the) { if($.trim(the.username.value)=="") { $.message({content:"\u8d26\u6237\u4e0d\u80fd\u4e3a\u7a7a"}); the.username.focus(); return false } if($.trim(the.password.value)=="") { $.message({content:"\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a"}); the.password.focus(); return false } var url,data; url=webroot+"user/login.asp?act=login"; data="username="+encodeuricomponent($.trim(the.username.value)); data+="&password="+encodeuricomponent($.trim(the.password.value)); $.ajax({ type:"post", cache:false, url:url, data:data, error:function(){alert("fail");}, success:function(_) { var act=_.substring(0,1); var info=_.substring(1); switch(act) { case "0": $.message({type:"error",content:info}); break; case "1": var gourl=$.trim(the.gourl.value); if(gourl==""){gourl="./"} if(gourl.indexof("login.asp")!=-1||gourl.indexof("reg.asp")!=-1){gourl="./"} $.message({type:"ok",content:info}); settimeout(function(){location.href=gourl},1000); break; default: $.message({type:"error",content:_,time:10000}); break; } }}); return false } $(function(){ $("#onlinepay .ip").focus(function(){$(this).removeclass();$(this).addclass('ipon');}); $("#onlinepay .ip").blur(function(){$(this).removeclass();$(this).addclass('ip')}); })