I have a variable (pvlist) an array which contains data like so ‘120123,345654‘. When I try passing only one value using window.open it works e.g when the array only has one value.
If I have more than one value in my array, I get a blank page with nothing. I have tried various solutions suggested which include:
window.open("../Functions/csv.php?refno="+pvlist);
window.open("../Functions/csv.php?refno="+pvlist+"");
window.open("../Functions/csv.php?refno="+pvlist.join(",")+"");
Any suggestion of what can be used to pass a variable with more than one comma separated value? all help appreciated.
EDIT
variable pvlist is a variable with comma separated values
You need the join method of array. That turns an array like this [1,2,3,4,5] into a string like this “1,2,3,4,5” (or whatever other separator you need)
Example: