Is there a way to trigger same location route in backbone.js, for example when location is /My/App/#/About
and user clicks again on anchor with the same route in order to refresh the page content.
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
Using Backbone 0.9.2 you pass in an options object and set 'trigger' to 'true'.
Reference: http://documentcloud.github.com/backbone/#Router-navigate
The solution for your specific problem isn't really documented and it seems the suggested best practice is to just call the function that is declared in the route you want to fire :/
Ref: https://github.com/documentcloud/backbone/issues/1214
So far the other answers are correct, but they forgot to mention that if the hash navigated to is the same as the current hash, nothing will fire.