2

I am using Backbone and javascript for developing a mobile single page application. I am facing a routing problem for Windows OS(WP8). The Web view of windows i.e. IE is not working the way it is supposed to.

I will explain it through an example. I have a dashboard, there are 3 buttons on the dashboard. Pressing each button will take you to a different view (MainView1, MainView2,MainView2). In Every MainView there are other sub views. On every sub view there is back button.

Whenever I move from one MainView to another MainView I am replacing the route i.e. route.navigate({replace : true}); and when I go from any mainview to its subviews I am adding its route(Sub View route) to the history stack. Every subview has a back button which executes history.back();

Now the expected behavior is DashBoard >> MainView1 >> SubView1 (pressed Back)

MainView1 ( pressed Back ) >> Dashboard >> Mainview2 >> SubView2 (pressed Back) >> MainView2 (pressed back) >> Dashboard.

Now in web browser(chrome) this is working as expected but in windows web view and android (OS 4.2 and below) web view, the expected functionality is not working. When I am pressing back button on these devices it is jumping to some random previous state. Its not taking to the expected previous page. Some times it is taking to Mainview1 from subview2 on pressing backbutton.

I found the similar disccusion over here https://groups.google.com/forum/#!topic/backbonejs/bFHeTfttkBY

Is there any workaround for this problem?

ayush bagaria
  • 199
  • 1
  • 1
  • 10

0 Answers0