Question

I have Backbone app (also using Chaplin.js on top of Backbone) and it works correctly with pushState. At some point I want to detect that app code is changed and reload page (reload app code). The problem is that when user is in '/some/path' I would like to reload backbone app and make it point to '/'. So far I tried:

when users is in /some/path -> location.reload() -> it reloads app but still in '/some/path'

when users is in /some/path -> location.href = location.origin -> it reloads app but still in '/some/path'

How I can just reload app in / path (and clearHistory) ?


This is solved - use window.location = '/'

Was it helpful?

Solution

Simply use window.location = '/';

This will redirect the user to the starting point of your application.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top