我有一个简单的请求,使用下面的Javascript代码刷新页面:
function tb_closeRefresh() {
window.location.reload(true);
}
Run Code Online (Sandbox Code Playgroud)
这在IE中运行良好,但Firefox只获取缓存版本,需要用户按F5才能获得最新版本的页面.
我添加了元标记:
<meta http-equiv="Pragma" content="no-cache">
Run Code Online (Sandbox Code Playgroud)
但这没有用.
有任何想法吗???
我正在使用 pushState 更改网站的网址:
history.pushState("", "info", "/info");
Run Code Online (Sandbox Code Playgroud)
这很好用,但现在后退按钮不起作用。我相信我需要使用 onPopState 编写自己的后退和前进按钮行为,该行为通过历史堆栈并呈现适当的页面。诀窍是,当“后退”为空时,它应该执行后退按钮通常会做的事情(在用户进入我的网站之前“返回”到页面)。
这似乎是非常标准的行为,是否有我可以使用的配方/一些标准代码?
基本上我有一个被加载的网址
http://somewebsite.com/Staging/hello/index.php?action=viewByGrid&subdo=show&projectID=-1&stat=1&workStageID=-1
Run Code Online (Sandbox Code Playgroud)
加载后。我希望 URL 显示为
http://somewebsite.com/Staging/hello/index.php?action=viewByGrid
Run Code Online (Sandbox Code Playgroud)
我需要在我的document.ready()加载后不久删除查询字符串
javascript ×2
back-button ×1
firefox ×1
html ×1
jquery ×1
pushstate ×1
query-string ×1
refresh ×1
url ×1