web开发常用的东东备份——利用jQuery的进行登录验证
???</div>
?
JS的代码
$.ajax({
???type: "post",
???url: app_base + "/sys/login.do",
???dataType : 'json',
???mode : "abort",
???data : $('.login').vdi_getInputDataObj(),
???success: function(data, textStatus){
????var res_code = data.res_code;
????if(res_code == 0){
?????window.location = "frame.jsp";
????}
????else{
?????$('#server_error').fadeIn("fast");
?????if(LANG["api." + res_code]){
??????$('.error_prompt_text').text(LANG["api." + res_code]);??????
?????}else{
??????$('.error_prompt_text').text(LANG["api.default"] + res_code);
?????}
?????$('#password').val("");
?????$('#username').focus();
?????$('#username').select();
????}
????loginwaiting = false;
???},
???error: function(){
????$.vdialert.error(LANG["api.error"]);
????loginwaiting = false;
???}
??});
?