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>
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) {
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);
}