locked
windows.history.back is behaving bit differently for me.

    Question

  • i am developing a windows store app using javascript and html5 in which i am using Window.history.back() to navigate to previous page. but in that case ihave to press that button twice to go back.

    will you please help me with this

    Tuesday, April 15, 2014 12:06 PM

All replies

  • Is the problem that back doesn't fire the first time or that it doesn't get called? Is the first button click getting blocked?

    Can you provide sample code demonstrating the problem?

    Tuesday, April 15, 2014 2:44 PM
    Owner
  • I also had this problem. It happened for me when I used the split template. When I snapped the screen to the minimum size, only either the listview or the details of a listview item would be displayed. When I selected a listview item, it would go to the item details. After doing this several times, I put the app back in full screen, and when I clicked the back button, it would navigate back to the same page. I would have to click the back button several times before actually going to the previous page. I think this could be because in the snapped view, the history is being cached every time you choose a listview item, which happens to be the same page. 

        I had this problem with the VS2012 split template, but I don't know if this exist for the VS2013 split template as well.

    Tuesday, April 15, 2014 5:26 PM
  • Thank you very much rob for your response.

    but i have done some research on this issue and i found out some facts those are as below.

    My Page has three tabs. by default a tab is visible and on click of a link another tab becomes visible and first one gets hide.

    when i land on this page and without disabling the current tab if i press on button which has Windows.history.back() it is working fine. but if i click on a link to show another tab and hide current tab after that i have to tap double time on back.

    Do you understand the scenario??

    Wednesday, April 16, 2014 5:32 AM
  • Hi datQkiD2 thank you very much for your response but in my case it seems it is not related to visual studio.

    it is something related to history stack on webview.

    Wednesday, April 16, 2014 5:35 AM
  • Hi datQkiD2 thank you very much for your response but in my case it seems it is not related to visual studio.

    it is something related to history stack on webview.

    Yes, I was actually referring to the stack, sorry for my poor choice of words. I had run into this problem when  I was using one of the templates is what I had meant.
    Wednesday, April 16, 2014 6:25 AM
  • but in my case i have to press it twice only even though i select three different tabs.

    btw what solution did you find for this. i am using Visula studio 2012 HTML5 and CSS3 blank page app.

    Wednesday, April 16, 2014 6:53 AM
  • I wish I did have a solution for you, but I never really figured it out. I wanted to prevent the app from adding to the history stack when I was in snapped view, but  then I ran into the problem of not being able to switch between my list view and item details =/.

         For my recent apps, I have come not to rely on the back button because of this, and I have made use of the navbar.  I was hoping I could find an answer here as well =)

     
    Wednesday, April 16, 2014 4:30 PM