admin管理员组文章数量:1332865
I have a link to reload the page with JS:
<a href="#" onclick="location.reload()">Reload</a>
How do I stop page reload after the location.reload() method has been called?
I have a link to reload the page with JS:
<a href="#" onclick="location.reload()">Reload</a>
How do I stop page reload after the location.reload() method has been called?
Share edited Jul 6, 2016 at 11:44 sdvnksv asked Jul 6, 2016 at 11:34 sdvnksvsdvnksv 9,71819 gold badges63 silver badges119 bronze badges 4- 6 Somewhat confusing. Could you please elaborate it? – vijayP Commented Jul 6, 2016 at 11:37
-
can't you remove
location.reload()
? – Madhawa Priyashantha Commented Jul 6, 2016 at 11:42 - @vijayP If you want to refresh the page in your browser, you can click the reload button. You can then stop the reload by clicking the stop reload button (the times icon). So the question was how do I stop page reloading with JS after the location.reload() method has been called. – sdvnksv Commented Jul 6, 2016 at 11:42
- Possible duplicate of I want to stop the browser request, when user clicks on any button from UI, like stop button on browser – xxxmatko Commented Jul 6, 2016 at 12:04
1 Answer
Reset to default 4You can use the following code:
window.stop();
Beware: Microsoft Internet Explorer and Edge don't support it.
本文标签: javascriptStop reloading the page after locationreload() has been calledStack Overflow
版权声明:本文标题:javascript - Stop reloading the page after location.reload(); has been called - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742292976a2448159.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论