Navigation problems RRS feed

  • Question

  • In my app, I have multiple buttons at the top which navigate to a specific page. The navigation works fine, but if the user was on a page and clicked the button to navigate to that page none of the code in the 'ready:' function gets ran. Here is a sample of my navigation:

    function Page1Nav() {


    If I were to navigate to one of the other pages then come back to the previous page the 'ready:' function is ran but still has problems when I click that button again. Hope that makes sense.

    Sunday, March 2, 2014 4:43 PM

All replies

  • Hi JYount,

    I may need ask few questions for understanding your real situation.

    Are you working with this kind of navigation patten? And where you put the ready() function in your code? And in your last words, you mean the event can be fired with other pages, only not fire while button clicked?

    If possible, could you share your demo with us for a better support?


    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, March 3, 2014 5:51 AM
  • Hi JYount,

    If ready() doesn't run, the navigation model isn't setup correctly. You need (1) navigator.js in your project w/correct reference from default.html, (2) default.html needs to host the navigation control (defined in navigator.js), and (3) the page needs to be defined as a Page Control. For more info, see "navigation model" section here: http://msdn.microsoft.com/en-us/library/windows/apps/hh758331.aspx

    I suggest you use the Navigation App template to get the code you need.

    Tuesday, March 25, 2014 11:26 PM
  • Also, it sounds like the problem occurs only when navigating to the same page (?). I don't think that is supported.

    See this thread:


    Instead of reloading the same page (WinJS.Navigation.location gives you the page Uri), you can move page initialization code to another function, then call that function from ready() and from whatever function you are when you want to reload the same page.

    Tuesday, April 1, 2014 7:19 PM