0

使用 Cordova 2.5.0 在 safari 中打开某些 url 的正确方法是什么?

我试过了:

if (navigationType == UIWebViewNavigationTypeLinkClicked && [[url scheme] isEqualToString:@"http"] || [[url scheme] isEqualToString:@"https"]) {
        [[UIApplication sharedApplication] openURL:url];
        return NO;
    }
    else {
        return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ];
    }

虽然,它没有工作。而且我的第一个加载是外部文档。

4

1 回答 1

0

要在外部浏览器中打开网页,请使用navigator.app.loadUrl('http://www.google.com', { openExternal:true } );

可能,现在 api 更改为window.open("http://www.google.com", "_system");没有经过真实测试

于 2013-07-15T05:45:15.260 回答