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

170
Views
Ajax responseText parsing to undefined

I'm trying to read a return body of a POST ajax call. It's returning an object "message" with a pair value regarding its price.

For some reason when I try to retrieve the "message"'s value I get undefined. I have tried a few methods including JSON.parse.

I don't want to simply string.replace out the content from the raw string as that would be a messy and ineffective solution.

In this specific example I am trying to retrieve "Please deposit: 1.50"

My function:

.always(function(returnBody){
console.log("raw: " + returnBody.responseText);

var parsed = JSON.parse(returnBody.responseText);
var item = parsed[0];

console.log("stringified: " + JSON.stringify(item));

My log content:

raw: {"message":"Please deposit: 1.50"}
stringified: undefined
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!