From b87854d5d583941a63e17f57373e9bfa3250b8c5 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 7 Oct 2014 12:45:03 +0100 Subject: Move the timeout code This appears to not break IE 11. --- src/leaflet-soton.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js index a1710e7..05c9e5f 100644 --- a/src/leaflet-soton.js +++ b/src/leaflet-soton.js @@ -1728,10 +1728,6 @@ SELECT * WHERE {\ function getJSON(options, callback) { var xhttp = new XMLHttpRequest(); - xhttp.ontimeout = function () { - callback(null); - }; - xhttp.timeout = 4000; options.data = options.data || null; @@ -1742,6 +1738,10 @@ SELECT * WHERE {\ } xhttp.open('GET', url, true); + xhttp.ontimeout = function () { + callback(null); + }; + xhttp.timeout = 4000; xhttp.setRequestHeader('Accept', 'application/json'); xhttp.send(options.data); -- cgit v1.2.3