Skip to content

Commit 82beabe

Browse files
author
Jason Moon
committed
Convert the data to a string using $.param()
1 parent 9309f8d commit 82beabe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

jQuery.XDomainRequest.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if (!jQuery.support.cors && window.XDomainRequest) {
3939
try {
4040
if (userType === 'json') {
4141
try {
42-
responses.json = jQuery.parseJSON(xdr.responseText);
42+
responses.json = $.parseJSON(xdr.responseText);
4343
} catch(e) {
4444
status.code = 500;
4545
status.message = 'parseerror';
@@ -71,8 +71,9 @@ if (!jQuery.support.cors && window.XDomainRequest) {
7171
text: xdr.responseText
7272
});
7373
};
74+
var postData = (userOptions.data && $.param(userOptions.data)) || '';
7475
xdr.open(options.type, options.url);
75-
xdr.send(userOptions.data||null);
76+
xdr.send(postData);
7677
},
7778
abort: function(){
7879
if (xdr) {

0 commit comments

Comments
 (0)