To call javascript function write the following lines :
NSString *getStringvalue=[webView stringByEvaluatingJavaScriptFromString:@"getName()];
Where getName() is a JavaScript function which return a String value.
and to send Objective C variable to JavaScript function:
[webView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"setDetails(\%@\,\%@\);,firstName,lastName]];
where setDetails is a javaScript function with firstName and lastName as a parameters.
0 Comment(s)