I am trying to send a javascript array via the url.But it fails
function viewReport(mode,someid){
if(mode==0){
var para= new Array();
para['para1'] = 'para1'||0;
para['para2']= 'para2' || 0;
console.log(para);
window.open('somePDFView/'+para,'_blank');
}else{
var para=[];
var paraelements={
para1:'anotherpara1'||0,
para2:'anotherpara2'||0
};
para[0]=paraelements;
window.open('somePDFView/'+para,'_blank');
}
}
On if part(mode=0)
, the para array is not sending any more and on else part (mode=1
) the
para is sends like this:
somePDFView/[object Object]
Which shows the error:
The URI you submitted has disallowed characters
How can we send an array via url.I can't use Ajax (because its a popup window) or session or storing in a temporary table.Also how can we retrieve this value in the controller.
Edit:
I miss an important thing that I am using codeigniter. Then I think it disallows special characters like - &,=,[,],etc..So if any other methods available for sending data as an array?..