2013-07-15 169 views
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 ]; 
    } 

雖然,它沒有工作。而且我的第一個負載是一個外部文檔。

回答

0

要打開外部瀏覽網頁,使用navigator.app.loadUrl('http://www.google.com', { openExternal:true });

也許,現在的API改爲window.open("http://www.google.com", "_system");沒有測試真正