Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I used the parser in my application but I cannot run properly.
My input to the parser is a html file and I want to run the commands and links within JavaScript code, it will give the output in the parser jurassic.

My code is :
C#
var engine = new Jurassic.ScriptEngine();
                           var scriptsource = new Jurassic.StringScriptSource(Uri.UnescapeDataString(html), null);

and :
C#
try
                           {
                               var ans = engine.Evaluate(Uri.UnescapeDataString(u1.URI.AbsolutePath));
                               u1 = new URL(engine.GetGlobalValue("document.location.href").ToString());
                           }

                           catch (Exception ex)
                           {
                               System.Windows.Forms.MessageBox.Show(ex.Message);
                           }

When i trace my code, this part, it does not run. Is there another code for it?
and for some url (for example bg.888.com), jurassic can not run functions that there is javascript links.
Posted
Updated 28-Apr-13 0:51am
v4
Comments
Richard MacCutchan 28-Apr-13 4:02am    
What is the problem? If you want help then you need to give more details. Please use the "Improve question" link and edit your question.
e.v.r 28-Apr-13 4:24am    
Thank you.

1 solution

I think it should be like this:

JavaScript
// First, give U1 a value...
u1 = new URL(engine.GetGlobalValue("document.location.href").ToString());
// ... and only later use it.
var ans = engine.Evaluate(Uri.UnescapeDataString(u1.URI.AbsolutePath));


Hope this helps,
Pablo
 
Share this answer
 
Comments
e.v.r 29-Apr-13 3:26am    
Thank you!
In fact, my problem is here:
var scriptsource = new Jurassic.StringScriptSource(Uri.UnescapeDataString(html), null);
in part, html code has to read, but Jurassic can not parse this source so any time syntaxs in try block, do not run.
Pablo Aliskevicius 29-Apr-13 4:54am    
It may be an issue with Jurassic itself.
Did you try to post one at their site?
http://jurassic.codeplex.com/workitem/list/basic
They have an 'issue tracker', and you can report bugs there.
e.v.r 29-Apr-13 5:03am    
Thank you.
I try but any body don't answer me.
:(

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900