Executing JavaScript code on Windows Store App

I have a JavaScript library (library.js file) with functions that I need to invoke from projects targeting multiple platforms (Mac, Windows Desktop, Windows 8.1, Android, etc..). For example, lets say I have an algorithm that that takes input A and returns B. The JavaScript library that has the implementation for translating A --> B should be reused across all platforms

For Windows RT, 8.1, 10 XAML based C# Store Apps, what options do I have to execute a JavaScript script at runtime? I am looking for a JavaScript engine that could execute scripts by taking input parameters and return me a value.

So far, I have found out that JINT interpreter works on 8.1, but the performance is slow for large scripts and I am looking for a tested and trusted JavaScript compiler similar to JavaScriptCore that iOS/Mac uses.


For Windows 8.x, you can host a hidden WebView control and load the JavaScript into that.

For Windows 10 Universal Apps, you can directly host the JavaScript runtime. It is exposed as a Win32 C-style API (not WinRT) so you will need to use some native code to get it working.


For Windows RT, 8.1, 10 XAML based C# Store Apps, what options do I have to execute a JavaScript script at runtime?

Essentially, you need a high performance JavaScript Engine like Google V8 on WinRT, but as far as I know, no such open source engine so far. My suggestion is hosting the JavaScript code on server side and consume it as a service or converting the JavaScript algorithm to C# code.

链接地址: http://www.djcxy.com/p/43682.html

上一篇: 有没有办法在Visual Studio 2010中快速查找文件?

下一篇: 在Windows Store App上执行JavaScript代码