summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs/luci-static
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2018-04-28 22:55:08 +0200
committerJo-Philipp Wich <jo@mein.io>2018-05-05 21:16:53 +0200
commit34821b15a5bf98ad951329d07b5ed3fe65623f8d (patch)
tree857b0bb99b57cf3c2cc0c0e612766d0a4c56d43b /modules/luci-base/htdocs/luci-static
parent6a1cdca34518fac1ca4ee2f77dad6ff60062bda5 (diff)
luci-base: xhr.js: fix timeout setting with IE 11
Internet Explorer 11 requires the timeout to be applied after the open() call, otherwise an invlaid state exception will be raised Fixes aa6c97154 ("luci-base: extend xhr.js") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/htdocs/luci-static')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/xhr.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/xhr.js b/modules/luci-base/htdocs/luci-static/resources/xhr.js
index 91dcf3fefe..de4476cdd3 100644
--- a/modules/luci-base/htdocs/luci-static/resources/xhr.js
+++ b/modules/luci-base/htdocs/luci-static/resources/xhr.js
@@ -54,11 +54,11 @@ XHR = function()
else
url += '?' + code;
+ xhr.open('GET', url, true);
+
if (!isNaN(timeout))
xhr.timeout = timeout;
- xhr.open('GET', url, true);
-
xhr.onreadystatechange = function()
{
if (xhr.readyState == 4) {
@@ -92,10 +92,11 @@ XHR = function()
callback(xhr);
}
+ xhr.open('POST', url, true);
+
if (!isNaN(timeout))
xhr.timeout = timeout;
- xhr.open('POST', url, true);
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhr.send(code);
}