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];