javascript - Stop reloading the page after location.reload(); has been called - Stack Overflow

I have a link to reload the page with JS:<a href="#" onclick="location.reload()"

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
Add a ment  | 

1 Answer 1

Reset to default 4

You 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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信