Answer the question
In order to leave comments, you need to log in
Why can't I access the property of an object in the response from the server?
Good afternoon. I'm trying to figure out ajax. I can not access the properties of the response object from the server. When outputting to the console, the object itself is displayed, when trying to get its property - undefined. How so? ... Here is a piece of the function where I am trying to apply:
$.ajax({
type: 'POST',
url: '/add.php',
data: msg,
success: function(data) {
console.log("Ответ json:",data);
console.log(data.w_client);
},
error: function(xhr, str){
alert('Возникла ошибка: ' + xhr.responseCode);
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question