ios中OC给js传值的方法

 JSContext *context=[_webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];

      

       

        NSString*funtionString=[NSString stringWithFormat:@"javascript:showExpressNumber('%@')",qrString];

         [context evaluateScript:funtionString];//通过oc方法调用js

posted @ 2017-07-03 17:38  雅尘恋  阅读(600)  评论(0编辑  收藏  举报