0

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!

Suresh Atta
  • 120,458
  • 37
  • 198
  • 307
user1217901
  • 31
  • 1
  • 4

1 Answers1

2

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));

Convert object string to JSON

Community
  • 1
  • 1
jrthib
  • 1,319
  • 1
  • 12
  • 17