Javascript Interpreter for .NET

╄→гoц情女王★ 提交于 2019-12-04 05:21:43

It's been some effort, but I've actually been able to retrofit Jint to work on WP7. There was a bit of reflection that was easily rewritten (mostly to marshal calls from JS to .NET objects), and a couple bugs that needed to be patched, but in the end it seems to be working.

Hopefully I'll be able to submit these back to the Jint project once I have some spare time.

http://jurassic.codeplex.com

Although I don't know if it is Compact Framework compliant.

Byron Whitlock

You can make JavaScript calls using the web browser control. It requires no additional libraries. You will need to do a little hacking around to make the control invisible, retrieving data etc, but it should do the trick.

Or you can try this project:

Javascript .NET integrates Google's V8 Javascript engine and exposes it to the CLI environment. Javascript .NET compiles (at runtime) and executes scripts directly from .NET code. It allows CLI objects to be exposed and manipulated directly from the executed Javascript.

Since this question was asked, Jurassic has been released. This is a .NET Javascript interpreter that works on the full CLR as well as the phone (or so they claim).

I haven't started to migrate to it yet, so I don't know if it works, but here it is for any of you that are interested.

As Bryan says, you can run your Javascript in the web browser control if you want to - I think this might be your only option if you do need to run JS.

There is also an effort underway to develop IronJS - https://github.com/fholm/IronJS - but I don't expect this to be ready for WP7 soon - nor do I expect it to be fully functional there.

If you could switch to a different scripting language - Ruby - then IronRuby is available on the phone (see the iron7 pics and videos for what can be done with it).

You should try: https://github.com/gatapia/js.net

I haven't tried on WP7 but may work?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!