Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

171
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda