success: function(result) { alert('Please try again.'); }, error: function(data) { var text = data.responseText; // ... processes the data here... }