Adobe Extending Dreamweaver CS4 Manuel d'utilisateur Page 363

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 387
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 362
357
EXTENDING DREAMWEAVER CS4
C-level extensibility
Returns
A Boolean value: JS_TRUE indicates success; JS_FALSE indicates failure.
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, JSObject *obj, char *script, unsigned intsz, JSVal *rval
The cx argument is the opaque JSContext pointer that passes to the JavaScript function.
The 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.
The 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.
The sz argument is the size of the string, in bytes. If sz is 0, the length of the null-terminated string is computed
automatically.
The rval argument is a pointer to a single JSVal structure. The function’s return value is stored in *rval.
Returns
A Boolean value: JS_TRUE indicates success; JS_FALSE indicates failure.
JSBool JS_ReportError()
Description
This function describes the reason for a script error. Call this function before returning the value JS_FALSE for a script
error to give the user information about why the script failed (for example, “wrong number of arguments”).
Arguments
JSContext *cx, char *error, size_t sz
The cx argument is the opaque JSContext pointer that passes to the JavaScript function.
The error argument is a string that contains the error message. The string is copied, so the caller should free the
string when it is not needed. If the string size is not specified (see the sz argument), the string must be null-
terminated.
The sz argument is the size of the string, in bytes. If sz is 0, the length of the null-terminated string is computed
automatically.
Returns
A Boolean value: JS_TRUE indicates success; JS_FALSE indicates failure.
Vue de la page 362
1 2 ... 358 359 360 361 362 363 364 365 366 367 368 ... 386 387

Commentaires sur ces manuels

Pas de commentaire