PhoneGap中文网

 找回密码
 立即注册
查看: 15730|回复: 0

cordova升级到6.4 object-c与JavaScript交互问题

[复制链接]

4

主题

6

帖子

60

积分

注册会员

Rank: 2

积分
60
发表于 2016-12-5 09:07:10 | 显示全部楼层 |阅读模式
在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()代码中
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

ionic4视频教程

Archiver|手机版|小黑屋| PhoneGap中文网 ( 京ICP备13027796号-1 )  

GMT+8, 2024-4-18 23:46 , Processed in 0.037323 second(s), 28 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表