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

Asked

Viewed 53 times

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;      
}

1 answer

0

Friend, to mount the url with various parameters you need to include the symbol & instead of spaces. Besides, Voce also cannot pass a variable inside a string like this doing in the case of "tag=all]".

Create a variable URL and add more or less like this:

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

And then in the case you call it:

window.location=url;                 
                

  • Thank you so much for teaching me Marcelo, now he this printandoo brand name correctly, however he is printing letter by letter, I want to print the entire Samsung for example and when press right go to LG, but it is printing letter by letter of Samsung and then goes to Lge so successively.....

  • I added the function that is printing this array Is it due to Document.querySelector ? it picks one by one? I will search!

  • Function initial(x) ' //Document.getElementById("styleId1")+all Smarcas[index]; //var num = index + 1; Document.querySelector("[name='tag']"). value = tag[index]; console.log(tag[index]+"tag that should be printed inside input---------"); //console.log(num+" number of my index I’m calling from another page-------"); }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.