Skip to content

Instantly share code, notes, and snippets.

@mackenziestarr
Created December 3, 2015 05:28
Show Gist options
  • Save mackenziestarr/121723cf53bf9451ee14 to your computer and use it in GitHub Desktop.
Save mackenziestarr/121723cf53bf9451ee14 to your computer and use it in GitHub Desktop.
// when updating the location path with search parameters
// add '?' to the path then serialize
Backbone.history.root = window.location.pathname + '?';
query = {"q":"Great Expectations"};
var url = $.param(query);
Backbone.history.navigate(url, {replace:true});
// localhost:8000/some/path?q=Great&20%Expectations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment