WEB客户端使用Javascript可以有很多种刷新页面的方法,总结一下如下:
window.location.reload();
window.history.go(0);
window.location.replace(window.location.href);
window.location.assign(window.location.href);
window.location.href=location.href;
window.location.assign(location.href);
document.execCommand('Refresh');
window.navigate(location.href);
window.open('自身页面','_self');
window.location.reload(true);
发现window.location.reload(),window.history.go(0)和document.execCommand('Refresh'),这三个方法是最快速的。其他的都有明显的浏览器滚动条的出现。
上面所有的方法都在IE7下测试过,未在FF下测试