Skip to content

Instantly share code, notes, and snippets.

@jamesmrobinson
Created May 4, 2016 05:29
Show Gist options
  • Save jamesmrobinson/b5ad13a733269fb4d9c3db964b16f243 to your computer and use it in GitHub Desktop.
Save jamesmrobinson/b5ad13a733269fb4d9c3db964b16f243 to your computer and use it in GitHub Desktop.
Strips GET query strings from a URL without reload by using history.pushState
var stripUrlStrings = function(){
if (window.location && window.location.href && window.history && history.pushState) {
var url = window.location.href;
url = url.split('?')[0];
history.pushState(null, null, url);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment