Verified Commit a605d772 authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3432151 by Tom Konda, longwave: [jQuery 4] ajax.js and jquery.form.js...

Issue #3432151 by Tom Konda, longwave: [jQuery 4] ajax.js and jquery.form.js use deprecated function $.parseJSON()
parent 9a06786e
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+1 −5
Original line number Diff line number Diff line
@@ -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);
					}