日期:2014-05-16 浏览次数:20678 次
function resetCoArr(){ $("#loadSecond").html(''); var checkUserConStr="<div class='form_row'><span class='span_title'></span><span class='span_contact'>"+ "<input type='button' value='检测用户' class='submit' onclick='checkUser()' />"+ "</span></div>"; $("#checkUserCon").html(checkUserConStr); } function checkUser(){ var login_username = $("#login_username").val(); var login_password = $("#login_password").val(); var urlStr='K_Login.php?action=loadCompany'; var dataStr='&login_username='+login_username+'&login_password='+login_password; $.ajax({ type:"POST", url:urlStr, data:dataStr, success: function (response) { //alert(response);return; var res_arr = eval("(" + response + ")"); if(res_arr['error']!=1){ //报错 alert('用户名不存在或密码错误!');return; }else{ $("#checkUserCon").html(''); var loadSecondStr=''; loadSecondStr+="<div class='form_row' id='co_name_con'>"+ "<span class='span_title'>公司:</span>"+ "<span class='span_contact'>"+ "<select class='contact_input' name='login_company' id='lv_co_id'>"; if(res_arr['loadCom'] != null && res_arr['loadCom'] != null){ for (var i = 0; i < res_arr['loadCom'].length; i++) { loadSecondStr+= "<option selected='' value='"+res_arr['loadCom'][i]['co_id']+"'>"+res_arr['loadCom'][i]['co_name']+"</option>"; } } loadSecondStr+="</select>"+ "</span> </div>"+ "<div class='form_row'>"+ "<span class='span_title'></span><span class='span_contact' style='_position:relative;'>"+ "<input type='button' value='登录' class='loginBtn' onclick='loginErp()' style='_position:relative;_position:absolute;_left:2px;_top:0px;'/>"+ "</span>"+ "</div>"; alert(loadSecondStr); $("#loadSecond").html(loadSecondStr); } } }); }