summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2016-01-27 17:42:10 +0100
committerPatrick Simianer <p@simianer.de>2016-01-27 17:42:10 +0100
commit4b201cb661909a2663b8f94fe9f7b27dca33c287 (patch)
treeba514ab0bc06f680363c89505fe895a8231c7af0
parentdf263a673e833a47010f6390546981d7211e7e39 (diff)
try to cope with timeouts [not working]
-rw-r--r--js/common.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/js/common.js b/js/common.js
index 4af7cd0..6ccc8ab 100644
--- a/js/common.js
+++ b/js/common.js
@@ -44,6 +44,10 @@ function trim(s)
return s.replace(/(\||\n|\t)/g, " ").replace(/^\s+|\s+$/g, '').replace(/\s+/g, " ");
}
+function updateProgress (oEvent) {
+ //alert(oEvent);
+}
+
/*
* cross-site request
*
@@ -52,7 +56,11 @@ function CreateCORSRequest(method, url)
{
var xhr = new XMLHttpRequest();
if ("withCredentials" in xhr) {
+ xhr.addEventListener("progress", updateProgress);
xhr.open(method, url, true);
+ xhr.timeout = 999999999999;
+ xhr.ontimeout = function () { alert("XHR TIMEOUT"); }
+ xhr.onerror = function () { alert("XHR ERRROR 1"); }
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=UTF-8');
} else {
xhr = null;