I have a JavaScript app where the method location.reload() is used. The method location.reload() is in a onclick event handler to reset the page, and this answer says that you need to return false; after location.reload() with onclick : How to reload a page using JavaScript.
location.reload();See this MDN page for more information.
If you are refreshing after an
onclickthen you'll need to return false directly afterlocation.reload(); return false;
Why should you return false; after method location.reload() using onclick?
<a>elements or form submission? - Chloe Andersonreturn falseafter the reload is necessary. I also thought they were talking about the answer of passingfalseto.reloadat first glance. @FilipHuhta - for what it's worth, there are a few comments challenging/questioning this assertion regarding returningfalseon that answer. - Alexander Nied