We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82beabe commit 4e2a3dbCopy full SHA for 4e2a3db
jQuery.XDomainRequest.js
@@ -5,6 +5,7 @@ if (!jQuery.support.cors && window.XDomainRequest) {
5
var httpRegEx = /^https?:\/\//i;
6
var getOrPostRegEx = /^get|post$/i;
7
var sameSchemeRegEx = new RegExp('^'+location.protocol, 'i');
8
+ var jsonRegEx = /\/json/i;
9
var xmlRegEx = /\/xml/i;
10
11
// ajaxTransport exists in jQuery 1.5+
@@ -37,7 +38,7 @@ if (!jQuery.support.cors && window.XDomainRequest) {
37
38
} else
39
*/
40
try {
- if (userType === 'json') {
41
+ if ((userType === 'json') || ((userType !== 'text') && jsonRegEx.test(xdr.contentType))) {
42
43
responses.json = $.parseJSON(xdr.responseText);
44
} catch(e) {
0 commit comments