简体   繁体   English

执行动态加载的javascript Windows Store应用

[英]Execute Dynamically loaded javascript Windows Store App

I'm currently developing a C#/xaml app using the WindowsRT/Metro framework 我目前正在使用WindowsRT / Metro框架开发C#/ xaml应用程序

Is there any way in Windows Store Apps to load and run javascript from a string? Windows Store Apps中是否可以通过任何方式从字符串加载和运行javascript? I'm looking to use Javascript in a similar way Game Engines would invoke LUA/Python scripts to perform dynamic functionality without recompiling the engine. 我希望以类似的方式使用Javascript,游戏引擎将调用LUA / Python脚本来执行动态功能,而无需重新编译引擎。 It seems IOS can achieve this using JavascriptCore 看来IOS可以使用JavascriptCore实现此目的

We're currently using javascript on other platforms to perform some simple logic at various stages of a workflow (eg User configured behaviour in a form or wizard such as populating fields based on already entered data). 当前,我们在其他平台上使用javascript在工作流的各个阶段执行一些简单的逻辑(例如,用户在表单或向导中配置的行为,例如根据已输入的数据填充字段)。 Ideally at certain points in the workflow I would like to be able to invoke a javascript function which had access to a simple API already defined in the application. 理想情况下,我希望能够在工作流中的某些点上调用可以访问应用程序中已定义的简单API的javascript函数。

Is this currently possible on Windows Store apps? 目前在Windows Store应用程序上可以吗?

The app will not be deployed on the normal Windows Store but rather used only in enterprise type deployments 该应用程序将不会部署在普通的Windows应用商店中,而只会在企业类型的部署中使用

load the html from the local file using webview.navigatetostring then you can inject the javascript and from with in the app you can use invoke script to call a function 使用webview.navigatetostring从本地文件加载html,然后可以注入javascript,然后在应用中使用调用脚本来调用函数

go through the link below Invoke script 通过下面的链接调用脚本

but i really would like to know how you would like to distribute the app for enterprise purpose. 但我真的很想知道您想如何为企业目的分发该应用程序。 I dont think that might be possible. 我认为这不可能。 Please explain. 请解释。

Windows 8 restricts use of dynamic code (injecting Dynamic HTML). Windows 8限制使用动态代码(注入动态HTML)。 You can possibly look at this link Run JavaScript from a string : you can use eval() function 您可以查看此链接从字符串运行JavaScript:可以使用eval()函数

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM