Skip to content

Instantly share code, notes, and snippets.

@benbonnet
Last active May 13, 2016 10:38
Show Gist options
  • Save benbonnet/05b2651f45a3d05a49e16c78dc1a43ce to your computer and use it in GitHub Desktop.
Save benbonnet/05b2651f45a3d05a49e16c78dc1a43ce to your computer and use it in GitHub Desktop.
History.Adapter.bind window, 'statechange', ->
$.ajax
url: url
type: "GET"
dataType: "script"
success: (data) ->
... replace previous content with new content ...
$(document).on "click", "a", (e) ->
e.preventDefault()
History.pushState { state: $(this).data("slug") }, $(this).data("title"), $(this).attr("href")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment