2

我有一个带有 JS 调用 window.location.reload(true) 的 aspx 页面,以在调用函数时强制刷新页面。

这似乎工作了几次,页面按预期重新加载,但到达调用函数的场景(即函数中的警报可见)但重新加载不会发生。我也尝试过设置具有相同结果的 window.location - 它工作 2 或 3 次然后失败。

这不会发生在 Firefox (16) 中,但会发生在不同版本的 IE (7 & 9) 中

使用Fiddler监控浏览器流量,reload运行时一切正常,但是reload停止时没有流量报告,提示浏览器没有向服务器发送请求?IE 窗口确实会随着加载微调器的旋转而变为空白,但最终 IE 会显示错误页面:

Internet Explorer cannot display the webpage 

Most likely causes:
You are not connected to the Internet. 
The website is encountering problems. 
There might be a typing error in the address.

这似乎锁定了浏览器。尝试访问另一个网站会在 Fiddler 中产生相同的输出(无)。打开一个新的 IE 窗口意味着我可以毫无问题地访问该站点。

这最初导致通过 __doPostBack 更新 UpdatePanels 时出现问题,因此页面的这种 JS 重新加载被视为一种快速解决方法,但似乎并非如此。

我倾向于认为这是与服务器相关的,但我无法在 Firefox 中复制该问题。然而不幸的是,这确实必须在 IE 中工作。

任何想法都非常感谢!

下面的 JS 片段(虽然这是非常简单的东西)

function ReloadWindow() {
    alert(window.location); // Can see this alert, even when page fails to reload

    window.location.reload(true);

}
4

0 回答 0