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?
It should not depend on the server side: By the URI standard specification, all parameters must have one name and should have one value. But there can be several parameters with the same name, which is the right way to serialize an array:
http://server/context?array=aaa&array=bbb&array=ccc&otherparameter=x
You could do it like this:
var s="";
for (var i=0;i< myArray.length;i++)
{
s+="&myArray="+myArray[i];
}
var url="http://server/context?"+s;