我在我的应用程序中使用uiwebview在应用程序中显示html页面。当应用程序从后台转到前台时,我想在html页面中调用javascript函数。我尝试过使用stringByEvaluatingJavaScriptFromString,但没有成功。
发布于 2013-03-12 21:59:00
如果您遇到一些问题,最好显示您的代码&如果您正确地使用了webview及其委托,那么它应该正确地调用方法,这就是我一直以来调用jscript方法的方式,它一直都是有效的。
[ self.myWebView stringByEvaluatingJavaScriptFromString: @"callJsMethod();" ]; 或者将值发送到jscript方法。
[self.myWebView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"callJScriptMethod('%d')", argInteger]];https://stackoverflow.com/questions/15363146
复制相似问题