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?