Instance Method

evaluateScript:

Executes the specified JavaScript code.

Declaration

- (JSValue *)evaluateScript:(NSString *)script;

Parameters

script

The JavaScript source code to evaluate.

Return Value

The last value generated by the script. Note that a script can result in the JavaScript value undefined.

Discussion

Evaluating a script runs any top-level code and adds function and object definitions to the context’s global object.

See Also

Evaluating Scripts

- evaluateScript:withSourceURL:

Executes the specified JavaScript code, treating the specified URL as its source location.