Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Created May 12, 2016 22:35
Show Gist options
  • Save Shelob9/b9ce29c451a19fa4715c479ee0372bad to your computer and use it in GitHub Desktop.
Save Shelob9/b9ce29c451a19fa4715c479ee0372bad to your computer and use it in GitHub Desktop.
Remove all query vars from current URL.
$( '.something' ).on( 'click', function (e) {
e.preventDefault();
var location = window.location;
var url = location.origin + location.pathname + location.hash;
history.replaceState( null, '', url );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment