documentcloud/backbone — Issue #1035: pushState does not change to <base> when empty fragment is provided
Author: idevelop
Created: 2012-02-21 17:40:33+00:00
State: open

When a URL is set in the HTML, calling Router.navigate(fragment) will correctly append the fragment to the . However, when navigating to the root of the app, the fragment is now "", and calling window.history.pushState with an empty string does not change the state.

My proposed fix (in Router.navigate) is:

```javascript
window.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, (frag == "") ? "." : frag);
```