JSBool JS_ExecuteScript()
Description
This function compiles and executes a JavaScript string. If the script generates a return value, it
returns in
*rval
Arguments
JSContext *cx
•
The
argument is the opaque
cx
•
The
argument is a pointer to the object in whose context the script executes. While the
obj
script is running, the
that passes to the JavaScript function.
•
The
argument is a string that contains JavaScript code. If the string size is not specified
script
(see the
argument), the string must be null-terminated.
sz
•
The
argument is the size of the string, in bytes. If sz is 0, the length of the null-terminated
sz
string is computed automatically.
•
The
argument is a pointer to a single
rval
stored in
*rval
Returns
A Boolean value:
JSBool JS_ReportError()
Description
This function describes the reason for a script error. Call this function before returning the value
for a script error to give the user information about why the script failed (for example,
JS_FALSE
"wrong number of arguments").
Arguments
JSContext *cx
•
The
argument is the opaque
cx
•
The
argument is a string that contains the error message. The string is copied, so the
error
caller should free the string when it is not needed. If the string size is not specified (see the
argument), the string must be null-terminated.
•
The
argument is the size of the string, in bytes. If sz is 0, the length of the null-terminated
sz
string is computed automatically.
Returns
A Boolean value:
.
,
,
JSObject *obj
char *script
JSContext
keyword is equal to this object. Usually this is the
this
.
indicates success;
JS_TRUE
,
,
char *error
size_t sz
JSContext
indicates success;
JS_TRUE
,
unsigned int sz
pointer that passes to the JavaScript function.
structure. The function's return value is
jsval
indicates failure.
JS_FALSE
pointer that passes to the JavaScript function.
indicates failure.
JS_FALSE
,
jsval *rval
pointer
JSObject
The C-level API
sz
363
Need help?
Do you have a question about the DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER and is the answer not in the manual?