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

374
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
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