here's my jQuery to parse Json result I got back from one of my page.
{"Result":true,"Action":"add"}
$.parseJSON(data) is not parsing it. I need to get Result and Action value.
$("#favorite").click(function () {
$.getJSON('/review/favorite/?Id=@(Model.Review.Id)', function (data) {
var result = $.parseJSON(data);
alert(result.Action);
if (result.result == true && result.action == "add") {
alert("add");
} else if (result.result == true && result.action == "delete") {
alert("delete");
}
});
return false;
});