Have tried :
function isJSON(str) {
try {
JSON.parse(str);
} catch (e) {
return false;
}
return true;
}
To check weather a string is json or not. It returns true for boolean type formats.
Is there any possible way to identify a valid json string in Java Script or in JQuery?