Switching from $.parseJSON to JSON.parse.

There are no modern browsers that do not have built in JSON parsing
abilities. We do not need $.parseJSON as it now just serves as a call
to JSON.parse.
This commit is contained in:
Brock Whittaker
2016-08-24 14:56:23 -07:00
committed by Tim Abbott
parent 636d2df868
commit e52d618f1b
7 changed files with 19 additions and 19 deletions

View File

@@ -34,7 +34,7 @@ function call(args, idempotent) {
if (xhr.status === 403) {
try {
if ($.parseJSON(xhr.responseText).msg.indexOf("CSRF Error:") !== -1) {
if (JSON.parse(xhr.responseText).msg.indexOf("CSRF Error:") !== -1) {
reload.initiate({immediate: true,
save_pointer: true,
save_narrow: true,
@@ -117,7 +117,7 @@ exports.xhr_error_message = function (message, xhr) {
if (xhr.status.toString().charAt(0) === "4") {
// Only display the error response for 4XX, where we've crafted
// a nice response.
message += ": " + $.parseJSON(xhr.responseText).msg;
message += ": " + JSON.parse(xhr.responseText).msg;
}
return message;
};