I would like to pass an array and added to a link on my page as a URL parameter, because later on the server side I need the values from the array. How should I do that?
I'd go with this approach,
var myArray = ['aaa', 'bbb', 'ccc', ]; var myArrayQry = myArray.map(function(el, idx) { return 'myArray[' + idx + ']=' + el; }).join('&'); // myArray[0]=aaa&myArray[1]=bbb&myArray[2]=ccc
Then, I retrieve the URL query params as an array on the server side.