I pass the data to the function:

var fdata = {'login': login, 'pass': pass}; function myfunc(fdata) { //... var token = 'test'; $.ajax({ type: 'POST', url: '/test.php', data: fdata, // <---------сюда //... } 

How to add to existing data 'token': token inside a function?

    1 answer 1

     var fdata = {'login': login, 'pass': pass}; function myfunc(fdata) { //... fdata.token = 'test'; $.ajax({ type: 'POST', url: '/test.php', data: fdata, // <---------сюда //... }