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

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

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