ajax

function loginMethod(){
        var uname=$("#uname").val();
         $.ajax({
             type: "POST",
             dataType:"json",
             url: "login.do",
             data: {"uname":uname,"oper":"ajaxlogin"},
             success: function(data){
                 //回调成功函数
                 var msg=data.msg;
                 var list=data.userlist;
                 $("#msg_span").html(''+msg+'');
                 var info="";
                 //展示列表信息
                 for(var i=0;i";
                 }
                 $("#user_list").html(info);
              },
              error:function(){
                  $("#msg_span").html('network connect error');
              }
          });
    }

你可能感兴趣的:(ajax)