【发布时间】:2013-10-13 20:34:45
【问题描述】:
我的 Objective-c 代码如下所示:
NSString *test = [NSString stringWithFormat: @"testFunction(%@)", details.name];
NSString *userName = [webView stringByEvaluatingJavaScriptFromString:test];
NSLog(@"Web response: %@",test);
这会打印出testFunction(the string of details.name here)。
我的 javascript 看起来像这样:
<script type="text/javascript">document.write(title);</script>
var title;
function testFunction(var) {
title = var;
}
【问题讨论】:
标签: javascript ios objective-c uiwebview uiwebviewdelegate