Answered by:
simple navigation

Question
-
I have two html pages (default.html and canvasball.html) and i want to navigate from the parent using some approach.
Guide please. THanks
maifs
- Edited by Mehmood Ahmed Wednesday, January 9, 2013 7:25 AM
Wednesday, January 9, 2013 7:23 AM
Answers
-
Hi maifs,
Actually, the Navigation and navigation history sample above has included the code you want. Please have a look.
And some code should as follow:
var destUrl = this.getRelativeUrl(eventObject.target.href); // Prevent the default browser navigation eventObject.preventDefault(); // Kick off a navigation WinJS.log && WinJS.log("Navigating to " + destUrl, "sample", "status"); WinJS.Navigation.navigate(destUrl, this.getNavState());
Roy
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Marked as answer by Mehmood Ahmed Thursday, January 10, 2013 10:51 AM
Thursday, January 10, 2013 3:24 AM
All replies
-
Hi,
Just refer to the example: Quickstart: Using single-page navigation (Windows Store apps using JavaScript and HTML) (Windows)
Any more question, please feel free to reply.
Roy
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.Wednesday, January 9, 2013 8:07 AM -
Hi Song,
Can't i see any short example Song?
maifs
Wednesday, January 9, 2013 8:19 AM -
Hi,
Sure.
#Navigation and navigation history sample
http://code.msdn.microsoft.com/windowsapps/Navigation-sample-cf242faa
Roy
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.Wednesday, January 9, 2013 8:25 AM -
Again thanks Song,
I have already seen this demo sample.
I am right now a newbie to it and still confusing from it.
Can't we see with a small sample here with some code chunk?
maifs
Wednesday, January 9, 2013 8:40 AM -
Hi,
OK. As my first reply. You can do that easily as follow:
<p><a href="/pages/page2/page2.html">Go to page 2.</a></p>
Roy
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- Edited by Song Tian Wednesday, January 9, 2013 8:56 AM
Wednesday, January 9, 2013 8:55 AM -
Song i don't want to go in a whole new page. Will it not be managed through master/child pages i mean like that?
We can use this approach through JavaScript navigation namespace.
WinJS.Navigation.navigate
maifs
- Edited by Mehmood Ahmed Wednesday, January 9, 2013 9:32 AM
Wednesday, January 9, 2013 9:25 AM -
Hi maifs,
Actually, the Navigation and navigation history sample above has included the code you want. Please have a look.
And some code should as follow:
var destUrl = this.getRelativeUrl(eventObject.target.href); // Prevent the default browser navigation eventObject.preventDefault(); // Kick off a navigation WinJS.log && WinJS.log("Navigating to " + destUrl, "sample", "status"); WinJS.Navigation.navigate(destUrl, this.getNavState());
Roy
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Marked as answer by Mehmood Ahmed Thursday, January 10, 2013 10:51 AM
Thursday, January 10, 2013 3:24 AM -
Thanks Song for your effort.
I want to know about state in Navigate method, if you could tell , it would be really appreciated.
maifs
Thursday, January 10, 2013 10:51 AM