I write come code with php, then i convert response in json. How i can check data from this response if ajax function. For example
$.ajax({
method: "POST",
dataType: "json",
data: user,
url: {{ path("indexAction") }}
}).done(function(data){
if(data['ok']){ // this does not work
var message = $('#message');
message.css("background","white");
message.css("display", "block");
}
});
If i alert(data) i have such data {"status":"ok","role":"user"}
. My question is how check my data for status "ok"?