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

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -