How to navigate between different html pages in Windows 8 Metro application using javascript?

纵饮孤独 提交于 2019-12-12 18:14:40

问题


How can i navigate between different html pages using javascript? I tried to use the below statement but it's not working. I have added a breakpoint and found that the below statement is executed.But still It doesn't display the page2.html.

WinJS.Navigation.navigate("page2.html", null);

Can anyone tell me why in what all scenarios it won't work ? One option I found was iframe which I haven't tried yet.


回答1:


This API isn't a specific page navigator; it's about loading the location as defined by the location service in WinJS: http://msdn.microsoft.com/en-us/library/windows/apps/hh452768.aspx has the details on the specifics of using that model.

That stated, if you wish to use the normal Web model of a new page, either a normal link, or setting the window.location to the other page will cause a browser navigate.



来源:https://stackoverflow.com/questions/11559490/how-to-navigate-between-different-html-pages-in-windows-8-metro-application-usin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!