Home Notices Documents Classes Download Others Rice
Classes  >  jsexecutor  >  Var(string)
jsexecutor class : Var(string) method

Description

Gets a value of JavaScript's global variable.

Syntax

jsexecutorInstance.Var(string varName)

Arguments

ClassNameDescription
stringvarNameA name of JavaScript's global variable.

Return value

ClassDescription
int,real,string, or boolIt has stored a value of JavaScript's global variable.

Sample code

Suppose jQuery has be loaded.

1:

jsexecutor jse = new jsexecutor();

2:

string varName = "$.fn.jquery";

3:

string version = jse.Var(varName); // jQuery's version will be returned.

Notes

The return value from JavaScript 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.