Section 25.185. JSObject.eval( ): evaluate a string of JavaScript code


25.185. JSObject.eval( ): evaluate a string of JavaScript code

Java method in Java plug-in

25.185.1. Synopsis

 public Object eval(String s) 

25.185.1.1. Arguments

s

A string that contains arbitrary JavaScript statements separated by semicolons.

25.185.1.2. Returns

The JavaScript value of the last expression evaluated in s, converted to a Java object.

25.185.2. Description

The eval( ) method of the Java JSObject class evaluates the JavaScript code contained in the string s in the context of the JavaScript object specified by the JSObject. The behavior of the eval( ) method of the Java JSObject class is much like that of the JavaScript global eval( ) function.

The argument s may contain any number of JavaScript statements separated by semicolons; these statements are executed in the order in which they appear. The return value of eval( ) is the value of the last statement or expression evaluated in s.




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net