-3

I just want to get ajax feedback

var result = $.ajax({
                url : 'linkAPI',
                type : 'get',
                dataType: 'JSON'
            });
            console.log(result);

and only responseTEXT appears.

Console.log(result.responseText);

// undefined

1 Answers1

0

You should log it in the success callback of AJAX as it is an asynchronous operation.

$.ajax({
    url : 'linkAPI',
    type : 'get',
    dataType: 'JSON',
    success: function(result) {
      console.log(result);
    }
});
Nikhil Goyal
  • 1,945
  • 1
  • 9
  • 17