Home Notices Documents Classes Download Others Rice
Classes  >  jsexecutor  >  direct JavaScript function call
jsexecutor class : direct JavaScript function call

Description

Calls a JavaScript function with Rice's method invocation notation.

Syntax

jsexecutorInstance.JavaScriptFunctionName(appropriateArguments)

Arguments

You can place the arguments in the order required by the JavaScript function. These arguments should be the int, long, real, string, or bool class.

Return value

ClassDescription
int,real,string, or boolIt has stored a return value from the JavaScript function.

Sample code

Suppose you have the following JavaScript function in currently displayed page.

1:

function square(number) {

2:

return number * number;

3:

}

Let's invoke the above JavaScript function with direct JavaScript function call.

1:

jsexecutor jse = new jsexecutor();

2:

int intRet = jse.square(5); // // The return value is the int class, and its value is 25.

This method call will be success though the jsexecutor class do not have the square(int) method.

Notes

You can call a JavaScript function with Rice's method invocation notation.

You can place the arguments in the order required by the JavaScript function. These arguments should be the int, long, real, string, or bool class.


The return value from JavaScript function must be evaluable as the int, real, string, or bool.

If the return value from JavaScript function can not evaluate as the above classes, an empty proxy is returned.Fixed in Ver 1.0.0.1.

If the return value from the JavaScript function can be evaluated as the above class, the corresponding Rice class is returned. Otherwise, the void class is returned.

Links for reference

None.

Copyright © Rice All rights reserved.