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

168
Views
¿Puede alguien decirme por qué mi respuesta ajax se anula?

Digamos que tengo un código similar a este:

 let thing = null; const xhttp = new XMLHttpRequest(); xhttp.onload = function() { thing = JSON.parse(this.responseText); } xhttp.open("GET", url); xhttp.send(); console.log(thing.propertyOfThing);

Este no es exactamente mi código, pero funciona para el propósito de esta pregunta. De todos modos, la solicitud GET funciona bien y se establece en el objeto JSON. Sin embargo, cuando el código llega a la instrucción console.log, de repente la cosa vuelve a ser nula y obtengo una NullPointerException (o al menos el equivalente de JavaScript) cada vez que trato de usar las propiedades del objeto JSON.

¿Alguien sabe por qué este es el caso?

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!