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

269
Views
Asigne valor a la variable cuando finalice la llamada ajax

Estoy desarrollando una aplicación web angular y me gustaría asignar el valor proveniente de una llamada AJAX a una variable. En realidad, probé muchas soluciones diferentes sin buenos resultados.

 let a = testFunction(); testFunction(){ let b; $.ajax({...}).done(function(e) { b = e + 1 }); return b } console.log("The value of 'a' plus the value coming from the AJAX call is: " + a)

Supongamos e=3, me gustaría tener este tipo de resultado en la consola:

 The value of 'a' plus the value coming from the AJAX call is: 4

Sé que puede ser bastante confuso, pero espero que me puedan ayudar.

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!