Skip to content

Commit

Permalink
more XMLHttpRequest.open() ordering for old IE (#777)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgravois committed Apr 28, 2016
1 parent 14b59d3 commit 152ef6b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Request.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,13 @@ function createRequest (callback, context) {

function xmlHttpPost (url, params, callback, context) {
var httpRequest = createRequest(callback, context);
httpRequest.open('POST', url);

if (typeof context !== 'undefined' && context !== null) {
if (typeof context.options !== 'undefined') {
httpRequest.timeout = context.options.timeout;
}
}

httpRequest.open('POST', url);
httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
httpRequest.send(serialize(params));

Expand All @@ -101,14 +100,13 @@ function xmlHttpPost (url, params, callback, context) {

function xmlHttpGet (url, params, callback, context) {
var httpRequest = createRequest(callback, context);
httpRequest.open('GET', url + '?' + serialize(params), true);

if (typeof context !== 'undefined' && context !== null) {
if (typeof context.options !== 'undefined') {
httpRequest.timeout = context.options.timeout;
}
}

httpRequest.open('GET', url + '?' + serialize(params), true);
httpRequest.send(null);

return httpRequest;
Expand Down

0 comments on commit 152ef6b

Please sign in to comment.