一: 在工程的targets->General->Linked Frameworks and Libraries 中导入JavaScriptCore.framework
二:在加载webView的试图控制器(eg:LSWebviewController)的LSWebviewController.h文件中制定JSExpor协议
1. 导入<JavaScriptCore/JavaScriptCore.h>
2. 监听js方法要遵循JSExpor协议,如下
一: 在工程的targets->General->Linked Frameworks and Libraries 中导入JavaScriptCore.framework