I get the following response from the server after doing an ajax request:
{"error":false,"success":true}
My ajax code:
$.ajax({
url: '/update',
type: 'post',
data: $(this).serialize(),
success: function(response) {
alert(response)
},
error: function() {
alert('An error occured, form not submitted.');
}
});
instead of alerting the whole response I want to alert the value of "success", which in this case would be true. How to do this?