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

Comments

Popular posts from this blog

C# Record Serialization

Versioned content in MVC

Add timestamp to photo using ImageMagick