Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

299
Vistas
How to display the json message from ajax call

How to display the message from ajax call which is type of object

$(document).ready(function(){
  $('#checkme').on('click', function () {
    //$('#checkme').attr('disabled',true); 
    $.ajax({
      type: "POST",
      url: '../api/api.php',
      data: $('#tmdt').serialize(),
      dataType: "JSON",
      success: function(response) {
        $("#idv").html();
      }
    });
  });
});
$return_msg = array('response'=>array('status'=>"Transaction type is not valid"));

enter image description here

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Given the format of the returned JSON you can use response.status, like this:

success: function(data) {
  $("#idv").html(data.response.status);
}

Note that if the returned string does not contain HTML, then you can use the text() method instead of html().

over 4 years ago · Santiago Trujillo Denunciar

0

Update your front end to..

success: function (response) {
    console.log(response);
    $("#idv").html(response.response.status);
}

Update your backend code to:

$return_msg = array('response'=>array('status'=>"Transaction type is not valid"));

echo json_encode($return_msg);
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda