Ajax请求地址拼接参数

    技术2022-07-10  132

    param() 方法创建数组或对象的序列化表示形式。

    var urldemo = { firstname:"John", lastname:"Doe", age:"50", eyecolor:"blue", } $.ajax({ url: "http://www.*****?"+$.param(urldemo), headers: { "content-type": "application/x-www-form-urlencoded", "withCredentials ":"true" }, data: data, type: 'POST', success: function (res) { }, error:function(err){ } });
    Processed: 0.011, SQL: 9