【发布时间】:2019-02-14 11:53:38
【问题描述】:
我有一个脚本,当值 >= 100 时重新加载页面问题是 location.reload(true);不在 ie11 中工作,我也尝试过 window.location = self.location.href;但是我遇到了同样的问题,在其他浏览器中效果很好。
$(function () {
if (value < 100) {
var timer = setInterval(function () {
$.ajax({
type: "GET",
url: $("#ancUrl").attr('href'),
data: {},
success: function (msg) {
console.log("This is msg:" + msg);
var msgInt = parseInt(msg);
if (msgInt > value)
value = msgInt;
},
error: function (err) {
console.log(err.responseText);
},
dataType: "json"
});
$("#progress-bar").width(value.toString() + "%");
if (value >= 100) {
clearInterval(timer);
window.location = self.location.href;
}
}, 2000);
}
});
【问题讨论】:
-
试试
window.location.href = window.location.href;
标签: javascript jquery ajax internet-explorer