你只需要做這樣的事情,看起來像你的設備還沒有準備好: - 請使用如下功能(需要phonegap.js)
if(ionic.Platform.isIOS()) {
{
// Wait for Cordova to load
document.addEventListener('deviceready', onDeviceReady, false);
// Cordova is ready
function onDeviceReady()
{
// open URL in default web browser
var ref = window.open(encodeURI(url), '_system', 'location=yes');
}
}
以下是關於窗口的一些細節.open函數
url:要加載的URL(字符串)。如果URL包含Unicode字符,則調用encodeURI()。 var ref = window.open(url,target,options);
目標:第二個參數可以如下:
_self:打開在科爾多瓦的WebView如果URL在白名單中,否則在InAppBrowser打開。
_blank:在InAppBrowser中打開。
_system:在系統的Web瀏覽器中打開。
選項:InAppBrowser的選項。可選,默認爲:location = yes。 (字符串)
選項字符串不能包含任何空格,並且每個要素的名稱/值對必須用逗號分隔。功能名稱不區分大小寫。所有的平臺都支持以下值:
位置: closebuttoncaption: clearcache: clearsessioncache:
請參閱本http://stackoverflow.com/questions/2899699/uiwebview-open-links-in-safari – Amar1989 2015-02-12 07:26:11