diff options
Diffstat (limited to 'modules/luci-base/htdocs/luci-static/resources/xhr.js')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/xhr.js | 7 |
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); } |