prajnavantha
prajnavantha

Reputation: 1131

Backbone route handlers not called on browser back button

I have Backbone routes like so:

route1 : http://localhost/#dash-campaigns/campaigns

route2 : http://localhost/#dash-campaigns/create

when i click on the browser back button when the user is in route2, the corresponsding routehandler functions are not called

My routes are defined as follows:

  routes: {
            "": "defaultRoute",
            "dash-campaigns/:query": "campView"
        }

This is basically happening becoz both of them have same hash, but note that the complete url is different. How do i solve this problem...?

Upvotes: 0

Views: 52

Answers (1)

rockerest
rockerest

Reputation: 10518

You need to enable HTML5 pushState to take advantage of hash events for route changes.

Upvotes: 0

Related Questions