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.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742292976a4416551.html
评论列表(0条)