Issue #3432151 by Tom Konda, longwave: [jQuery 4] ajax.js and jquery.form.js use deprecated function $.parseJSON()
parent
9a06786e2f
commit
a605d772b6
|
@ -554,7 +554,7 @@
|
|||
// Sanity check for browser support (object expected).
|
||||
// When using iFrame uploads, responses must be returned as a string.
|
||||
if (typeof response === 'string') {
|
||||
response = $.parseJSON(response);
|
||||
response = JSON.parse(response);
|
||||
}
|
||||
|
||||
// Prior to invoking the response's commands, verify that they can be
|
||||
|
|
|
@ -922,10 +922,6 @@
|
|||
|
||||
return (doc && doc.documentElement && doc.documentElement.nodeName !== 'parsererror') ? doc : null;
|
||||
};
|
||||
var parseJSON = $.parseJSON || function(s) {
|
||||
/* jslint evil:true */
|
||||
return window['eval']('(' + s + ')'); // eslint-disable-line dot-notation
|
||||
};
|
||||
|
||||
var httpData = function(xhr, type, s) { // mostly lifted from jq1.4.4
|
||||
|
||||
|
@ -943,7 +939,7 @@
|
|||
}
|
||||
if (typeof data === 'string') {
|
||||
if ((type === 'json' || !type) && ct.indexOf('json') >= 0) {
|
||||
data = parseJSON(data);
|
||||
data = JSON.parse(data);
|
||||
} else if ((type === 'script' || !type) && ct.indexOf('javascript') >= 0) {
|
||||
$.globalEval(data);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue