javascript - Ajax function: data fields with multiple value -


i have doubt data fields of ajax function.

usually, have syntax ajax function may be:

$.ajax({         url: "/aaa/bbb/ccc",         method: "somemethod",         data: somedata,         success: function (response) {             } 

my question is: in data fields, can put more 1 data? in other words, can pass from:

data: somedata, 

to:

data: data1, data2, data3... 

and on?

here how can build multiple params, hold them in object , send them json.stringify():

var paramstosend = {}; paramstosend['data1'] = 'data1'; paramstosend['data2'] = 'data2'; $.ajax({     ...     data: {params:json.stringify(paramstosend)},     ... }); 

Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -