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

126
Views
how to get data from ajax response?

i am calling ajax and my success function says

success: function (data) {
        console.log(data.data);
},

And my response is

{"data":{"response":"{\"ResCode\":\"TPB009\",\"ResStatus\":1}","http_code":200}}

i want to fetch ResCode so i tried this

console.log(data.data.response['ResStatus']);
        console.log(data.data.response['ResCode']);
        

but it is undefine any help?

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

0

Your response seems to be in JSON format, use JSON parse

success: function (data) {
   var jso = JSON.parse(data);
    ...
},
about 4 years ago · Juan Pablo Isaza Report

0

data.data.response is a JSON string, you need to parse it.

let response = JSON.parse(data.data.response);
console.log(response.ResStatus, response.ResCode);
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!