Reload page in javascript
To reload a page without re-posting, you may have seen something like:
location.href = "" + location.href;
This doesn’t work if there’s a hash in the URL. Instead, do this:
location = location.href.split("#")[0];
Software development tutorials and demos lasting no more than 60 seconds. No in-depth explanations, no off-topic rants, and no slides. One small topic per video - only code, console, config, and client. All videos come with a corresponding blog entry, and all code is available on GitHub.
To reload a page without re-posting, you may have seen something like:
location.href = "" + location.href;
This doesn’t work if there’s a hash in the URL. Instead, do this:
location = location.href.split("#")[0];
Comments
Post a Comment