Instance Method

evaluateJavaScript:completionHandler:

Evaluates a JavaScript string.

Declaration

- (void)evaluateJavaScript:(NSString *)javaScriptString completionHandler:(void (^)(id, NSError *error))completionHandler;

Parameters

javaScriptString

The JavaScript string to evaluate.

completionHandler

A block to invoke when script evaluation completes or fails.

Discussion

The method sends the result of the script evaluation (or an error) to the completion handler. The completion handler always runs on the main thread.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software