views:

46

answers:

2

Hello I need help !!! I am trying to evaluate javascript from html page based on HTML (I mean some of the variables in javascript function are using html tag id )

  1. I need to use it multiple threads (Not UI) so this means that i can not use WebBroser.

  2. I can not use Eval.JScriptEvaluate because the javascript depends on the html

Is there is any way to achieve this with this limitations

Maybe there is web Service that revives html as string and lets execute some specific script

Any help will be appreciated

Thanks

A: 

You'll need to parse and execute the script - there's a number of projects out there to help with this see:

FinnNk
The links you supplied as i understood do not supply does not meet the requirements - they use COM object (this means i can not use it multi threaded )or evaluating only javascript.Or there is the way to parse html to javascript that i don't know about
Robob
A: 

Can you give more detail in your question. e.g. Do you have control over this page that you are trying to run (in which case, maybe you could solve your multiple thread requirements with HTML5 webworkers) and why do you need multiple threads?

Here is one link you might find interesting which, with some work on your side would allow you to load web pages into Rhino (a server side, javascript interpreter) and execute the javascript.

Another link to check out is HTMLunit, which also allows you to simulate a browser that can execute javascript code from within Java.

Adam