我想在不重新加载的情况下更改html。我是这样做的:
$('#left_menu_item').click(function(e) {
if (!!(window.history && history.pushState)) {
e.preventDefault();
history.pushState(null, null, newUrl);
}
});它工作正常。但如果我想返回“后退”按钮-浏览器更改了上一页的url,但它不会重新加载页面。为什么?
发布于 2014-02-02 15:02:59
window.onpopstate = function(event) {
if(event && event.state) {
location.reload();
}
}这是我使用的:)
https://stackoverflow.com/questions/14824766
复制相似问题