Refresh BackboneJS on with same URL hash?

kidcapital picture kidcapital · Mar 29, 2012 · Viewed 14.7k times · Source

My current backbone application has a url:

localhost/#users

Is there a way to access localhost/#users while at the URL localhost/#users so it refreshes the page?

Currently, when I am at localhost/#users and I try

window.location.hash = #users or myBackboneRouter.navigate("users")

it does not trigger a page refresh.

Answer

Fizer Khan picture Fizer Khan · Jun 29, 2013

To refresh same page in backbone, you have to use

Backbone.history.loadUrl(Backbone.history.fragment);