Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

234
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda