I'm making a JavaScript app where I use the method location.reload(). 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
onclick
then you'll need to return false directly afterlocation.reload(); return false;
Why should you return false;
after method location.reload()
using onclick
?