Great questions. 

The current implemenation of the JavaScript function
is super simple...Basically it handles any javascript
statement that you can put in one line and does a
basic eval. For example, if the browsers date needs to
be passed in to a form, you can call the JavaScript
function with (new Date()).getTime() as the first
parameter. (We needed the ability to do just that for
testing our product.)

It relies on the Mozilla Rhino javascript engine
(specifically the js.jar from the rhino download).
Mike checked it into the /lib directory, so you don't
have to worry about setting classpath or anything
else. It's a pretty good engine and fully implements
JavaScript 1.5, without any specific browser
functionality (you can't get to anything in the
browser's DOM such as document or document.forms if
you're used to writing javascript in the context of a
web page). Basically, it's the core language and
nothing else, so you can do text manipulation, math,
boolean logic, etc. The language spec can be
downloaded from
http://www.ecma-international.org/publications/standards/ECMA-262.HTM

Right now you are restricted to calling built-in
functions, but I do think a JavaScriptConfig class is
in order that would allow to write your own JavaScript
functions or load them from a file. Could be very
useful.

Also, Rhino has built-in Java adapters for doing
call-backs into the system, which could also be very
useful. I haven't looked into how this works yet, so
if anyone has the time and is super interested in
doing this, check out the docs at
http://www.mozilla.org/rhino/

Hope this helps.

Regards,

Thad

--- [EMAIL PROTECTED] wrote:
> 
> 
> The new JavaScript function sounds like it will be a
> great thing.  I'm sure the
> user community will like it.
> 
> Could somebody explain how to use the new JavaScript
> function?  Let's assume
> that I know very little about JavaScript.  ;^)
> 
> Here are a few of the things I am curious about:
>    Do I have to download a particular JavaScript
> implementation from somewhere?
>    Do I need to set up particular environment
> variables in a certain way
>    (analagous to JAVA_HOME)?
>    Am I restricted to calling built-in JavaScript
> functions?
>    If I can write my own functions, do they need to
> be in a particular place?
> 
> A brief example would also be nice.
> 
> Thanks for your help,
> Keith
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to