jquery - $.ajax() joining two data objects -
lets want join 2 data sets in $.ajax call such:
updatedata: function(datadetails) { $.ajax({ url: './example.php', data: { lets:"get", real:"funky" }, type: "post", datatype: "json", }); } datadetails in function argument contains set of data, such as...
{ a:"1", b:"2", c:"3" } how should declare in data: area of $.ajax() if want join these sets?
i believe $.extend() utility should work here:
data: $.extend({ lets:"get", real:"funky" }, datadetails)
Comments
Post a Comment