PhoneGap中文网

标题: cordova升级到6.4 object-c与JavaScript交互问题 [打印本页]

作者: gaoyunxiahappy    时间: 2016-12-5 09:07
标题: cordova升级到6.4 object-c与JavaScript交互问题
在CDVUIWebViewNavigationDelegate.m中
- (void)webViewDidFinishLoad:(UIWebView*)theWebView
{
    NSLog(@"Finished load of: %@", theWebView.request.URL);
   
    [self.webView stringByEvaluatingJavaScriptFromString:@"AutoLogin()"];
   
    CDVViewController* vc = (CDVViewController*)self.enginePlugin.viewController;

    // It's safe to release the lock even if this is just a sub-frame that's finished loading.
    [CDVUserAgentUtil releaseLock:vc.userAgentLockToken];

    /*
     * Hide the Top Activity THROBBER in the Battery Bar
     */
    [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];

    [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPageDidLoadNotification object:self.enginePlugin.webView]];
}

[self.webView stringByEvaluatingJavaScriptFromString:@"AutoLogin()"];这句话走不到JS  function AutoLogin()代码中
作者: ionicwang    时间: 2016-12-8 21:09
用低版本试试




欢迎光临 PhoneGap中文网 (http://bbs.phonegap100.com/) Powered by Discuz! X3.2