[英]Sharing JavaScript code between .NET desktop and browser
I have a set of core, complicated JavaScript data structures/classes that I'd like to be able to use both in the browser as JavaScript and run on the desktop with .NET 3.5. 我有一组核心的,复杂的JavaScript数据结构/类,我希望既可以在浏览器中将它们用作JavaScript,又可以在具有.NET 3.5的桌面上运行。 Is it possible to compile web-friendly JavaScript into assemblies that my C# code can access?
是否可以将网络友好的JavaScript编译为我的C#代码可以访问的程序集?
If neither of those work, I guess my options are to: 如果这些都不起作用,我想我的选择是:
Anyone have success with any of these options? 任何人都能成功使用这些选项吗?
JScript.Net is actually mostly EMCAScript3 compliant. JScript.Net实际上主要符合EMCAScript3。 As long as you treat your code as a processing library (only have it do crunching, etc - use callbacks to interact with the program), you should be fine.
只要将代码视为处理库(仅对代码进行处理等-使用回调与程序进行交互),就可以了。 I'm doing something similar, using javascript as my core parsing library, and then using it within python, dotnet, and php.
我正在做类似的事情,使用javascript作为我的核心解析库,然后在python,dotnet和php中使用它。
Managed JavaScript (IronJScript) appears to have been killed. 托管JavaScript(IronJScript)似乎已被杀死。 See this answer :
看到这个答案 :
How about another option: 另一个选择如何:
Is this possible? 这可能吗?
You can also access the DOM from WebBrowser control but not everything you want is fully supported. 您还可以从WebBrowser控件访问DOM,但并非完全支持所需的所有内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.