diff --git a/lib/adapters/xhr.js b/lib/adapters/xhr.js index 479bdbc..8c790c1 100644 --- a/lib/adapters/xhr.js +++ b/lib/adapters/xhr.js @@ -27,6 +27,8 @@ module.exports = function xhrAdapter(resolve, reject, config) { request = new window.XDomainRequest(); loadEvent = 'onload'; xDomain = true; + request.onprogress = function handleProgress() {}; + request.ontimeout = function handleTimeout() {}; } // HTTP basic authentication @@ -41,10 +43,6 @@ module.exports = function xhrAdapter(resolve, reject, config) { // Set the request timeout in MS request.timeout = config.timeout; - // For IE 9 CORS support. - request.onprogress = function handleProgress() {}; - request.ontimeout = function handleTimeout() {}; - // Listen for ready state request[loadEvent] = function handleLoad() { if (!request || (request.readyState !== 4 && !xDomain)) {