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

373
Views
How do I get a variable from one function on a js file and use it for another function on another js file?

enter image description here

I would like to get the var username, and use it in:

enter image description here

I just need to find a way to append the var username from thee function loginMe(), to user_url, so that I can retrieve data from mysql.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

There are no way to get variable value from one function to another unless you pass it by parameter or set it as global variable.

When executing loginMe(). You can pass value by calling getUserInfo( username ). Or when you are executing loginMe() you can set username in localStorage and get it in getUserInfo() function from localStorage. Or You can set the value as global variable by window.username then you will be able to access it.

about 4 years ago · Juan Pablo Isaza Report
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!