-2

Hi friends How do I get only the main message here is to show my j44?

error: function (xhr, status, errorThrown) {
alert(xhr.responseText);
}

enter image description here

Meysam Saberi
  • 184
  • 4
  • 20

1 Answers1

0

make it

error: function (xhr, status, errorThrown) {
   alert(JSON.parse(xhr.responseText).category[0]);
}
gurvinder372
  • 66,980
  • 10
  • 72
  • 94
  • 2
    That will throw an exception. `xhr.responseText.category` is `undefined`, you can't access `[0]` of `undefined`. – Quentin Mar 11 '16 at 12:54