I have the following in a controller and don't understand why it is not calling the function in the page (it doesn't do anytihng). Any help is appreciated - first time using this:
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *fullURL = @"http://local.com/js-more.html"; // this does laod
NSURL *url = [NSURL URLWithString:fullURL];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[arcWebView loadRequest:requestObj];
NSString * param = @"foo";
NSString * jsCallBack = [NSString stringWithFormat:@"myFunc('%@')",param];
[arcWebView stringByEvaluatingJavaScriptFromString:jsCallBack];
and in the web page I have:
<script>
function myFunc(this_str){![enter image description here][1]
alert('here is val: ' + this_str);
}
myFunc('here is in string');
</script>
and this gets alerted correctly in a browser or in an embedded UIWebView.
thx in advance
edit 1