Skip to content

Commit f6f2abb

Browse files
committed
IE 11 flips out if you set the timeout after calling send
1 parent 180a168 commit f6f2abb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/leaflet.utfgrid.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
L.Util.ajax = function (url, success, error) {
1+
L.Util.ajax = function (url, timeout, success, error) {
22
// the following is from JavaScript: The Definitive Guide
33
// and https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest_in_IE6
44
if (window.XMLHttpRequest === undefined) {
@@ -30,6 +30,7 @@ L.Util.ajax = function (url, success, error) {
3030
}
3131
};
3232
request.ontimeout = function () { error('timeout'); };
33+
request.timeout = timeout;
3334
request.send();
3435
return request;
3536
};
@@ -283,8 +284,7 @@ L.UtfGrid = (L.Layer || L.Class).extend({
283284
var successCallback = this._successCallbackFactory(key);
284285
var errorCallback = this._errorCallbackFactory(url, key);
285286
return function () {
286-
var request = L.Util.ajax(url, successCallback, errorCallback);
287-
request.timeout = this.options.requestTimeout;
287+
var request = L.Util.ajax(url, this.options.requestTimeout, successCallback, errorCallback);
288288
return request;
289289
}.bind(this);
290290
},

0 commit comments

Comments
 (0)