So from what I understand, because I created a JSON object in PHP using json_encode and then used echo to display it, I can access it directly as an object in JS, like this
.done(function(response) {
var result = response;
$(result).hide().prependTo('#messages').fadeIn('slow');
});`
However, how do I access the data within the object? My object contains error which will be either true or false, and error_message while contains the errors formatted as <li>error</li>
PHP returns this - {"error":true,"error_messages":" <li>Name too short (minimum of 4 characters)<\/li> <li>Name too short (minimum of 4 characters)<\/li>"}
response.error,response.error_message