My mistake was that a special built-in method was built into the main system. Not.
Just do the following line of code
window.history.pushState('object or string', 'Title', '/new-url');
will change the URL of your browser without reloading the page. You can open the javascript console in your browser right now and try it on this page. This article explains how this works in more detail (as noted in this SO page ).
Now I have associated the following event with the document object (I am launching the site on one page):
bindEvents: () -> $(document).on('click', 'a', @pushstateClick) pushstateClick: (e) -> href = e.target.href || $(e.target).parents('a')[0].href if MyApp.isOutsideLink(href) == false if e.metaKey
See this post for more details.
Note that you can pass the pushstate: true option to your call to Backbone.history.start (), but it just makes it so that going directly to a specific page (e.g. example.com/exampleuser/followers) will call and not just nowhere.
Peter Berg
source share