admin管理员组文章数量:1271757
How can I force a page refresh of page 1 when a user returns to it from page 2 by pressing the back button? Are there vbscript or javascript approaches or is it down to set the 'no cache' somehow?
How can I force a page refresh of page 1 when a user returns to it from page 2 by pressing the back button? Are there vbscript or javascript approaches or is it down to set the 'no cache' somehow?
Share Improve this question edited Feb 9, 2012 at 18:15 JC JC 12.1k11 gold badges44 silver badges63 bronze badges asked Feb 9, 2012 at 17:46 Mark_54Mark_54 1,3034 gold badges15 silver badges21 bronze badges2 Answers
Reset to default 6Set a cookie on page 2.
If the cookie is detected on page 1, reload the page.
What about doing something like this?
<script>
if (document.referrer == "http://www.page2.html")
window.location.reload();
}
</script>
Just throw that at the top of your page 1 and this should work.
Update
I also found a solution on the Webdeveloper. forums as well.
本文标签: javascriptForce a page refresh when page visited from back buttonStack Overflow
版权声明:本文标题:javascript - Force a page refresh when page visited from back button - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741139422a2345945.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论