Issue
How to convert JSON to plain text?
{"Days":["is not a number"]}
to Days is not a number.
Here is the code:
$('.best_in_place').bind("ajax:error", function(jqXHR,error, errorThrown) {
alert(error.responseText);
});
Solution
Convert the response into JSON object and parse its key-value pair
var error = JSON.parse( error.responseText );
for( var name in error ) {
console.log( name + " " + error[ name ] ); // Days is not a number
}
Answered By - Ravi K Thapliyal Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.