jint

Load a DOM and Execute javascript, server side, with .Net

烈酒焚心 提交于 2019-11-27 04:42:08
I would like to load a DOM using a document (in string form) or a URL, and then Execute javascript functions (including jquery selectors) against it. This would be totally server side, in process, no client/browser. Basically I need to load the dom and then use jquery selectors and text() & type val() functions to extract strings from it. I don't really need to manipulate the dom. I have looked at .Net javascript engines such as Jurassic and Jint, but neither support loading a DOM, and so therefore can't do what I need. I would be willing to consider non .Net solutions (node.js, ruby, etc) if

How do I load a JavaScript file with Jint in C#?

穿精又带淫゛_ 提交于 2019-11-26 21:24:07
问题 I want to load a JavaScript file using Jint, but I can't seem to figure it out. The documentation said I could do something like engine.run(file1) , but it doesn't appear to be loading any files. Do I need to do something special with the file name? Here's my JavaScript file: // test.js status = "test"; Here's my C# JintEngine js = new JintEngine(); js.Run("test.js"); object result = js.Run("return status;"); Console.WriteLine(result); Console.ReadKey(); If I put in code manually in Run it

Load a DOM and Execute javascript, server side, with .Net

我怕爱的太早我们不能终老 提交于 2019-11-26 11:19:01
问题 I would like to load a DOM using a document (in string form) or a URL, and then Execute javascript functions (including jquery selectors) against it. This would be totally server side, in process, no client/browser. Basically I need to load the dom and then use jquery selectors and text() & type val() functions to extract strings from it. I don\'t really need to manipulate the dom. I have looked at .Net javascript engines such as Jurassic and Jint, but neither support loading a DOM, and so