Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

232
Visualizações
How do I pass multiple paramaters in javaScript Window command

I have a single page application that has back navigation via a back link shown at the top of the page. Each screen of the application has it's own function, I store the function name and parameters in arrays and have an event listener which uses the JS window function to call the function.

    prevPage="showPage1";
    prevParm=['a','b'];     

    prevParm1=("a","b");
    prevParm2='a,b';
    prevParm3=("a","b","c");    

    //window["navHelper"][prevPage](prevParm);
    //window["navHelper"][prevPage]("a","b"); // works 
    //window["navHelper"][prevPage]["a","b"]; 
    
    
    window["navHelper"][prevPage](prevParm3);

showPage1 is a function within the navHelper class

This works for a single parameter but not where there are multiple parameters.

How do I pass two parameters to function using window? I tried passing an array and various other methods and can't get it to work.

There is a jsfiddle showing the issue here: https://jsfiddle.net/zacmarshall/j6Lxa0u1/3/

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda