1

I'm building a navigation app for Windows 8 using Html & JS. For some of my div's, I am handling the onclick to do the following code, WinJS.Navigation.navigate("/pages/video/video.html"), which is a video page that simply plays a video. Before that code is called, I'm setting a hidden input element in default.html , <input id="currentVideoId" type="hidden" /> with the value of the video id that is clicked.

That way, on my video page, I can grab the current value of the hidden input to figure out which video to ajax load for the user.

Question: how can I instead navigate the user to /pages/video/video.html?id=555 ? I tried that, but my video.html did not seem to load at all. If I can do that, then in my video.js file I can look for the query string var to get the id of the video it should play.

Issue: if I don't do this, then if I go from 1 video to another video (I have an "Up next" control on each video page pointing to the next video in sequence), the back button doesn't work correctly as it just goes to the last video played.

4

1 に答える 1

2

2 番目のパラメーターで同じnavigate関数を使用できます。

WinJS.Navigation.navigate("/pages/video/video.html", videoId);
于 2012-12-12T17:43:28.360 に答える