addCSS(); initUser(); function addCSS() { var link = document.createElement('link'); link.type = 'text/css'; link.rel = 'stylesheet'; link.href = '/css/byw_signIn.css'; //CSS所在文件,不同服务器,修改成不同的文件所在地址 document.getElementsByTagName("head")[0].appendChild(link); } var $layerwidth, $layerheight; $("#login_key").on("click",function(){ $layerwidth=screen.width>550?'450px':'100%'; $layerheight=screen.width>550?'420px':'100%'; layer.open({ area: [$layerwidth,$layerheight], //宽高 btn:false, title:'会员登录', content:'
', }) }) $("body").on("click","#userloginbutton",function(){ var u,p; var url,data; u=$("#membername").val(); p=$("#password").val(); if(u==''){ alert("用户名不能为空"); return; } if(p==''){ alert("密码不能为空"); return; } $.getJSON("https://member.baiyewang.com/user/login/login_api.php?type=LOGIN&membername="+u+"&password="+p+"&logincallback=?", function(data){ if(data.token != '0'){ //alert(data.user); $("#byloginul").html("