Extending Flash |
|
||
| C-Level Extensibility > The C-level API > JSBool JS_ExecuteScript() | |||
JS_ExecuteScript (JSContext *cx, JSObject *obj, unsigned short *script, unsigned int sz, jsval *rval)
Method; compiles and executes a JavaScript string. If the script generates a return value, it returns in *rval.
JSContext *cx, JSObject *obj, unsigned short *script, unsigned int sz, jsval *rval
cx argument is the opaque JSContext pointer that passes to the JavaScript function.obj argument is a pointer to the object in whose context the script executes. While the script is running, the this keyword is equal to this object. Usually this is the JSObject pointer that passes to the JavaScript function.script argument is a string that contains JavaScript code. If the string size is not specified (see the sz argument), the string must be null-terminated. sz argument is the size of the string, in bytes. If sz is 0, the length of the null-terminated string is computed automatically. rval argument is a pointer to a single jsval structure. The function's return value is stored in *rval.A Boolean value: JS_TRUE indicates success; JS_FALSE indicates failure.
|
|
||