I am experiencing a strange problem while trying to parse JSON strings in jQuery AJAX response. Here is my code:
$.ajax({
type: "POST",
url: "Save",
data: {
expiry: expiry,
settings: settings
}
}).done(function (msg) {
alert(msg);
var obj = jQuery.parseJSON(msg);
if (obj.status == "done") {
window.location = obj.redirect;
}
});
On IE, Chrome, and Safari, I am getting JSON string in alert, but on Firefox, I am getting
[obj XMLDocument]
in the alert.
Here is FF console:
obj is null, but I can see the response JSON string in the console under text attribute
responses=Object { xml=document, text="{"status":"done","redir...ippetImage\/s\/6abb68"}
Any reason for this behavior?