sdvnksv
sdvnksv

Reputation: 9668

Stop reloading the page after location.reload(); 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?

Upvotes: 2

Views: 19044

Answers (1)

Angel Politis
Angel Politis

Reputation: 11313

You can use the following code:

window.stop();

Beware: Microsoft Internet Explorer and Edge don't support it.

Upvotes: 4

Related Questions