summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Baines <cb15g11@soton.ac.uk>2014-10-07 12:45:03 +0100
committerChristopher Baines <cb15g11@soton.ac.uk>2014-10-07 12:45:22 +0100
commitb87854d5d583941a63e17f57373e9bfa3250b8c5 (patch)
tree1ec703b135c8541cba467af1cf1288ca18bf0106 /src
parent5f043713e59030cfdcf722e25ffb034a103080ab (diff)
downloadleaflet-soton-b87854d5d583941a63e17f57373e9bfa3250b8c5.tar
leaflet-soton-b87854d5d583941a63e17f57373e9bfa3250b8c5.tar.gz
Move the timeout code
This appears to not break IE 11.
Diffstat (limited to 'src')
-rw-r--r--src/leaflet-soton.js8
1 files 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);