0
更新內的XMLHttpRequest 2 HTML5進度條:更新HTML5進度條內XMLHTTPRequest.onreadystatechange
for (var i = 0; i < times.value; i++) {
xhr.open("POST", uri, false);
xhr.send(payload);
restSendBar.value += 100/times.value;
console.log(i + "th times");
}
和
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
restRxBar.value += 100/times.value;
}
};
在Firefox中,作爲for循環執行進度條被更新。在Chrome中,進度條在for循環完成後更新。
這是更新進度欄的正確方法嗎?
這是Chrome中的錯誤嗎?
阿倫
更多的周邊代碼將有所幫助。 我會在哪裏設置這個時間? – 2013-03-01 18:38:54
您將替代您的'restRxBar.value'調用。 – monsur 2013-03-02 02:37:59
仍然沒有變化,進度條在for循環後更新。 – 2013-03-03 12:05:38