Reputation: 31
Normally Ajax syntax is
ajax('fn_name'['filter_value'],'target')
But I am using 3 filters in my page and so wanted to send all 3 values to ajax call.
ajax('fn_name'['filter1','filter2','filter3'],'target')
Is above syntax correct? Its not working.... Thanks in advance!
Upvotes: 0
Views: 119
Reputation: 1319
To send these multiple values, i would serialize that array into JSON then process the JSON data in whatever backend is receiving it.
var filterArray = { 'fn_name': ['filter1', 'filter2', 'filter3'] };
ajax(JSON.stringify(filterArray));
Upvotes: 2