how to pass the MARK variable that receives an Array per Javascript URL to another page? what am I doing wrong?

0
function escolheControle(c) {   
controle = c;
marca =todasAsmarcas[controle];
window.location="marcaWebkit.htm";
console.log(controle+' controle-----');
console.log(todasAsmarcas+' todasAsmarcas-----');

}

var marca; 
var todasAsmarcas = new Array(4);
    todasAsmarcas[0] = new Array("Samsung", "LG", "Sony", "SempToshiba", "Panasonic", "AOC", "CCE", "Philips", "Sharp", "Toshiba", "Gradiente", "Philco", "Buster", "Semp", "Hitachi", "Sanyo", "Blue Sky", "Mitsubishi", "Aiko", "Cineral", "JVC", "Zenith");
    todasAsmarcas[1] = new Array("Samsung", "LG", "Sony", "SempToshiba", "Panasonic", "AOC", "CCE", "Philips", "Sharp", "Toshiba", "Gradiente", "Philco", "Buster", "Hitachi", "Sanyo", "Blue Sky", "Mitsubishi", "Aiko", "Cineral", "JVC", "Zenith");
    todasAsmarcas[2] = new Array("Samsung", "LG", "Sony", "SempToshiba", "Panasonic", "AOC", "CCE", "Philips", "Sharp", "Toshiba", "Gradiente", "Philco", "Buster", "Hitachi", "Sanyo", "Blue Sky", "Mitsubishi", "Aiko", "Cineral", "JVC", "Zenith");
    todasAsmarcas[3] = new Array("Samsung", "LG", "Sony", "SempToshiba", "Panasonic", "AOC", "CCE", "Philips", "Sharp", "Toshiba", "Gradiente", "Philco", "Buster", "Semp", "Hitachi", "Sanyo", "Blue Sky", "Mitsubishi", "Aiko", "Cineral", "JVC", "Zenith");


function onRcu(e) {     
switch (e.keyName) {                
       case iAppLib.keys.OK:
           switch(pagina){
            case "menuWebkit":
                escolheControle(contMenu);
                window.location="marcaWebkit.htm?contMenu=0  marca=todasAsmarcas[controle] controle=c index=0";                 
                console.log("OKAY");
                //top.main.escolheControle(contMenu);
                break;
           }
            break;      
}
    
asked by anonymous 22.01.2018 / 15:16

1 answer

0

Friend, To mount the url with several parameters you need to include the & instead of spaces. Besides that, you also can not pass a variable within a string like this doing in the case of "mark = allAsmarcas [control]".

Create a URL variable and add something like this:

var url = "marcaWebkit.htm?contMenu="+contMenu+"&marca="+todasAsmarcas[controle]+"&controle="+c+"&index="+index;

And in case you call it like this:

window.location=url;                 
                
    
22.01.2018 / 15:29