MPFF 7.1 - Windows 8.1 应用程序在 运行 in visual studio 时出错
MFPF 7.1 - Windows 8.1 Application gives error while run in visual studio
我正在使用 MPFF 7.1 最新修复。已安装 Visual Studio 2015 和 Windows phone 以及通用 SDK 和模拟器。
在eclipse中搭建环境,在Visual Studio中打开项目。构建和部署是成功的。但是在尝试使用 运行 进行调试时,它给出了以下错误。
按照警报中的建议,禁用设置中的分解选项。但仍然出现相同的错误。在 Angular.js 和 worklight.js
中出现此错误
您应该查看以下博客 post,其中讨论了在具有 MobileFirst Platform Foundation 的 Windows 应用程序中使用 AngularJS 等框架时可能出现的异常:https://developer.ibm.com/mobilefirstplatform/2015/10/13/javascript-add-dynamic-content-errors-in-mfp-win8-winrt-apps/
博客 post 提出了可能的解决方法:
To avoid or ignore such errors while using the frameworks in your app, Microsoft provides a way to disable the scripts injection validation. It can be disabled by just wrapping the function that injects the content dynamically with MSApp.execUnsafeLocalFunction and in this way your code works without errors.
示例:
MSApp.execUnsafeLocalFunction(function() {
var body = document.getElementsByTagName('body')[0];
body.innerHTML = '<div style="color:' + textColor + '">example</div>';
});
博客中的更多信息 post。
我正在使用 MPFF 7.1 最新修复。已安装 Visual Studio 2015 和 Windows phone 以及通用 SDK 和模拟器。
在eclipse中搭建环境,在Visual Studio中打开项目。构建和部署是成功的。但是在尝试使用 运行 进行调试时,它给出了以下错误。
按照警报中的建议,禁用设置中的分解选项。但仍然出现相同的错误。在 Angular.js 和 worklight.js
中出现此错误您应该查看以下博客 post,其中讨论了在具有 MobileFirst Platform Foundation 的 Windows 应用程序中使用 AngularJS 等框架时可能出现的异常:https://developer.ibm.com/mobilefirstplatform/2015/10/13/javascript-add-dynamic-content-errors-in-mfp-win8-winrt-apps/
博客 post 提出了可能的解决方法:
To avoid or ignore such errors while using the frameworks in your app, Microsoft provides a way to disable the scripts injection validation. It can be disabled by just wrapping the function that injects the content dynamically with MSApp.execUnsafeLocalFunction and in this way your code works without errors.
示例:
MSApp.execUnsafeLocalFunction(function() {
var body = document.getElementsByTagName('body')[0];
body.innerHTML = '<div style="color:' + textColor + '">example</div>';
});
博客中的更多信息 post。