欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

ajax中的参数为一个对象

程序员文章站 2022-07-02 18:01:13
ajax中的参数为一个对象 var user ={ username : $("#username").val(),...
ajax中的参数为一个对象
 var user ={
            username : $("#username").val(),
            password  : $("#password").val()
        }
 $.ajax({
            type:"post",
            url:"https://localhost:8080/GD/LoginAction_execute.action",
            data:user,
            dataType:"text",
            success:function (data) {
                alert("登录成功");     
            }
        })