I have an ajax request that returns an array (data) :
{"errors":{"first_name":1,"last_name":1,"email":1},"error":1}
I used :
var obj = $.parseJSON(data);
I can check the error value using obj['error'] but now, I need to loop the errors array to add/remove an error class on each appropriate field. I don't know how to extract it and create the loop (with $.each, for instance). I have to mention I'm not supposed to know each key name, that's what I need to get.