ios8 - How can I binding an object to JS when using the WKWebview -
i met problem.
i replaced uiwebview wkwebview ,but how can pass oc object js.
can object conform jscontext protocol?
before
-(void)webviewdidfinishload:(uiwebview *)webview { [self.webview.scrollview.mj_header endrefreshing];
_jscontext = [webview valueforkeypath:@"documentview.webview.mainframe.javascriptcontext"]; _jscontext.exceptionhandler = ^(jscontext *context, jsvalue *exceptionvalue) { context.exception = exceptionvalue; nslog(@"%@", exceptionvalue); }; _jscontext[@"token"] = self.token; [self.webview stringbyevaluatingjavascriptfromstring:@"getuser()"];
}
now how can inject token js
Comments
Post a Comment