Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

230
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!