[UWP] [HTML]使用JavaScript在UWP App中进行页面导航/重定向 [英] [UWP][HTML]Page Navigation/Redirection in UWP App using JavaScript

查看:93
本文介绍了[UWP] [HTML]使用JavaScript在UWP App中进行页面导航/重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




 我正在使用 HTML5 /开发 UWP 应用CCS3 / Javascript , 在表单验证I,我无法重定向/导航到
相同窗口框架中的其他html文件。而是在默认浏览器中打开(仅当处于https://模式时,否则不执行任何操作)。

 I'm developing an UWP app using HTML5/CCS3/ Javascript ,  on form validation I,m not able to redirect / navigate to other html file in same window frame . Instead its opening in an default browser (only if is in https:// mode  AND no action otherwise) .

我尝试过: 

I,ve tried :  

- >    window.open(" file:/// C:/Users/Kanimozhi%20Muthu/Documents/Visual%20Studio%202017/Projects/HereMyAm/HereMyAm/mainApp.html" ;,"_ self"," height = 1360, width = 700,fullscreen = 1,resizable = 0");



- >   location.href =" file:/// C:/Users/Kanimozhi%20Muthu/Documents/Visual%20Studio%202017/Projects/HereMyAm/HereMyAm/mainApp.html" ;;

-- >    window.open("file:///C:/Users/Kanimozhi%20Muthu/Documents/Visual%20Studio%202017/Projects/HereMyAm/HereMyAm/mainApp.html", "_self", "height=1360,width=700,fullscreen=1,resizable=0");

-->   location.href = "file:///C:/Users/Kanimozhi%20Muthu/Documents/Visual%20Studio%202017/Projects/HereMyAm/HereMyAm/mainApp.html";

- > window.location.assign(QUOT; HTTPS://www.w3schools.com"," _parent");          &NBSP ;                        &NBSP ;                        &NBSP ;                        &NBSP ;                       

-->window.location.assign("https://www.w3schools.com","_parent");                                                                                                             

- >  window.open(" https://www.google.com"," _self"," height = 100,width = 600,resizable = 1");      


-->  window.open("https://www.google.com", "_self", "height=100,width=600,resizable=1");      

我需要在同一个窗口(来回)加载html,请帮我这样做。提前致谢!

I needed to load html in same window (back and forth) , please help me in doing this . Thanks in advance !




                              


                             

推荐答案

嗨  Aagash Mugilan,

Hi Aagash Mugilan,

Welcome
到开发通用Windows应用程序论坛!
  请使用   标记 
发布到这个论坛时,谢谢!

在uwp中,我们不能使用" file:/// C :/Users/Kanimozhi%20Muthu/Documents/Visual%20Studio%202017/Projects/HereMyAm/HereMyAm/mainApp.html"访问文件。默认情况下,应用只能访问某些文件系统位置。您可以放置​​mainApp。 html
进入您的应用安装目录并使用  " ms-appx:/// mainApp.html " ;. $ b访问它$ b 更多信息,您可以参考文件访问权限 和

跳过路径:坚持使用StorageFile

In uwp, we can not use "file:///C:/Users/Kanimozhi%20Muthu/Documents/Visual%20Studio%202017/Projects/HereMyAm/HereMyAm/mainApp.html" to access a file. Apps only can access certain file system locations by default. You can put the mainApp.html into your Application install directory and access it by using "ms-appx:///mainApp.html". More information, you can refer to File access permissions and Skip the path: stick to the StorageFile.

此外,我们建议将JavaScript uwp应用程序作为单页应用程序。

Besides, we recommend that the JavaScript uwp app to be a Single Page Application.

祝你好运,

Breeze


这篇关于[UWP] [HTML]使用JavaScript在UWP App中进行页面导航/重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆