My objective-c code looks like this:
NSString *test = [NSString stringWithFormat: @"testFunction(%@)", details.name];
NSString *userName = [webView stringByEvaluatingJavaScriptFromString:test];
NSLog(@"Web response: %@",test);
This prints out testFunction(the string of details.name here)
.
My javascript looks like this:
<script type="text/javascript">document.write(title);</script>
var title;
function testFunction(var) {
title = var;
}