Skip to content

Instantly share code, notes, and snippets.

@weber
Created June 4, 2013 13:05
Show Gist options
  • Select an option

  • Save weber/5705744 to your computer and use it in GitHub Desktop.

Select an option

Save weber/5705744 to your computer and use it in GitHub Desktop.
History.js события на кнопки «назад»«в перед»
window.History.Adapter.bind (window, 'statechange', function() {
if (typeof History.Adapter.artificial != "undefined") {delete (History.Adapter.artificial); return}
.... your code here .....
})
window.History.pushStateOriginal = window.History.pushState
window.History.pushState = function (state, string, url) {
window.History.Adapter.artificial = true
window.History.pushStateOriginal (state, string, url)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment