我的HTML5应用程序无法在VS(Windows Phone 8.1 HTML应用程序项目)上运行,我想调试JS错误,但无法弄清楚 [英] My HTML5 app can't work on VS (Windows Phone 8.1 HTML App Project), I want to debug the JS errors but I cant figure it out

查看:69
本文介绍了我的HTML5应用程序无法在VS(Windows Phone 8.1 HTML应用程序项目)上运行,我想调试JS错误,但无法弄清楚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的HTML5应用程序无法在VS(Windows Phone 8.1 HTML应用程序项目)上运行,我想调试JS错误,但我不知道该怎么做.似乎该错误与跨源请求有关(框架将页面加载到同一文件夹中),因为它发生了 当我将其放在Android Webview上时也是如此,但他们具有启用它的配置.感谢您的任何帮助

My HTML5 app can't work on VS (Windows Phone 8.1 HTML App Project), I want to debug the JS errors but I cant figure it out how to do it. It seems the error is about Cross origin requests (the framework loads pages in the same folder), because it occur too when I put it on an Android webview but they have the configuration to enable it. Any help is appreciated

推荐答案

Farrell Raafi,

Hi Farrell Raafi,

如何在Windows Phone 8.1 App Project中使用JS?

How do you use your JS in your Windows Phone 8.1 App Project?

如果JS脚本是用JS文件编写的,并且您在HTML页面中引用了该JS文件,则可以按照以下步骤调试该JS文件.

If the JS script is write in JS file and you reference this JS file in a HTML page, then you can debug this JS file with following steps.

  1. 右键单击Windows Phone 8.1项目,然后选择调试"选项卡.
  2. 将应用程序"进程和后台"任务进程的调试器类型"设置为脚本".
  3. 然后在您的JS文件中添加断点,并且在Windows Phone模拟器上调试该应用程序时会遇到断点.

但是在将调试器类型设置为脚本"后,将不会命中C#代码中的断点.

But after you set the Debugger type as "Script", the breakpoints in C# code will not be hit.

如果您直接用HTML编写JS脚本,恐怕在Windows Phone仿真器/设备上运行应用程序时,我们无法直接通过Visual Studio调试JS代码.但是您可以右键单击HTML文件,然后选择在浏览器中查看". 然后,您可以按F12键打开IE调试器工具来调试JS代码.

If you write the JS script in HTML directly, I'm afraid that we could not debug the JS code through Visual Studio directly when running the app on Windows Phone emulator/device. But you could right-click the HTML file and choose "View in Browser". Then you could press F12 to open the IE debugger tool to debug the JS code.

最好的问候,
Weiwei

Best Regards,
Weiwei


这篇关于我的HTML5应用程序无法在VS(Windows Phone 8.1 HTML应用程序项目)上运行,我想调试JS错误,但无法弄清楚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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