Edit: Oh, sorry, I missed that you wanted to place the image in a UIImageView
. Andiihs answer will guide you better than mine. I will keep my answer for anyone stumbling into this looking for how to run JavaScript.
Just use stringByEvaluatingJavaScriptFromString:
and you have executed the JavaScript on the loaded page in your UIWebView
. This scripts reads the page title and places it in the "pageTitle" variable.
NSString *pageTitle = [myWebView stringByEvaluatingJavaScriptFromString:@"document.title"];
You can also perform any methods etc...
[myWebView stringByEvaluatingJavaScriptFromString:@"doSomething('Hello!'); doSomethingElse('And again...');"];