Hi Sumana,

You can extract the JS and run it, but the main point is that browser 'objects' 
are not implemented by Rhino.

Have a look into HtmlUnit, as it providers the DOM/HTML objects/methods, and 
have the needed functionality to simulate real browsers, using Rhino as a 
JavaScript engine.

Yours,
Ahmed----
Blog: http://asashour.blogspot.com 

________________________________
From: Sumana <[email protected]>
To: [email protected]
Sent: Friday, May 1, 2009 7:12:02 AM
Subject: Executing scripts embedded within HTML?


Is it possible to execute javascript function embedded in an HTML
page? or can Rhino only deal with .js files?

For example, I'd like to know if given this literal string:

<html><script>var a = 1; function f1() {return 1;}</script></html>

can I get Rhino to execute function f1()?

Is there anyway I can invoke f1() programmatically from Rhino?

Thanks for your input!

Sumana
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino



      
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to