Skip to content

Instantly share code, notes, and snippets.

@matori
Created February 12, 2015 02:14
Show Gist options
  • Save matori/9d195d051e03c884f009 to your computer and use it in GitHub Desktop.
Save matori/9d195d051e03c884f009 to your computer and use it in GitHub Desktop.
URL からハッシュ値を取得したあとにハッシュを消して履歴を修正
// @link http://stackoverflow.com/a/5298684
var hashString = location.hash.substr(1); // remove '#'
history.replaceState('', document.title, window.location.pathname);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment