Robocide
Robocide

Reputation: 6751

Best way to use javascript api for a desktop app

i have a desktop application and i really want to use some APIs that are only available in their Javascript version.... (Waze API/Google Earth API), my question ... what is the best way if you think its possbile and worth it to perform this bridge between my C# desktop app with this javascript API ?

Upvotes: 0

Views: 857

Answers (2)

toby
toby

Reputation: 902

You can execute JScript from C#. Add a reference to Microsoft.JScript and use something like this:

using Microsoft.JScript;
object result = Microsoft.JScript.Eval.JScriptEvaluate("my javascript code", Microsoft.JScript.Vsa.VsaEngine.CreateEngine());

Upvotes: 1

Darin Dimitrov
Darin Dimitrov

Reputation: 1039468

javascript is not adapted for desktop applications. You could use a WebBrowser to embed some web page widget which will execute the javascript.

Upvotes: 0

Related Questions