Answer the question
In order to leave comments, you need to log in
How to get data from json object in jquery?
there is an object
{readyState: 4, responseText: "{"companies-phone":["Phone must be an integer."]}", responseJSON: Object, status: 200, statusText: "OK"}
for (var key in textStatus.responseJSON) {
var val = textStatus.responseJSON[key];
}
Answer the question
In order to leave comments, you need to log in
{"companies-phone":["Phone must be an integer."]}
So the field itself is in the array, which is why the array is obtained.
Something like this:
for (var key in textStatus.responseJSON) {
var val = textStatus.responseJSON[key][0];
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question