As we know,Apple provide the javascriptcore.framework to work with javascript, and we can get the jscontext of uiwebview like this: JSContext *context = [_webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"]; then we can invoke Script using context or implementating JSExport methods. Now,my project must be compatible with ios5, but I want to invoke ios-object in javascript directly, do you have any ideas?
由于部署目标低于7.0时不允许链接JavaScriptCore.framework,因此无法支持iOS 5。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.