Skip to content

Instantly share code, notes, and snippets.

@fredsterss
Created December 7, 2012 22:49
Show Gist options
  • Save fredsterss/4237171 to your computer and use it in GitHub Desktop.
Save fredsterss/4237171 to your computer and use it in GitHub Desktop.
Pushtate for Backbonejs hack in IE
Backbone.history.start({
pushState: Modernizr.history,
silent: true
});
if (!Modernizr.history) {
rootLength = Backbone.history.options.root.length;
fragment = window.location.pathname.substr(rootLength);
search = window.location.search;
return Backbone.history.navigate(fragment + search, {
trigger: true
});
} else {
return Backbone.history.loadUrl(Backbone.history.getFragment());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment