2016-05-26 12 views
2

私は単純にwindow.open()を使用しています。ユーザーはテキストフィールド内の任意のものを検索し、推奨リンクをクリックするので、デバイスブラウザで結果が開きます。私のコードは、システムブラウザ(chrome)とアンドロイドデバイスで正常に動作していますが、iosデバイスでは動作しません。以下に私のコードを見てください。iosデバイスでIonic window.openが動作しません。

angular.forEach($scope.data, function(value, key) { 
 
      var pageListElement = ""; 
 
      if(value.Name != undefined) { 
 
      angular.forEach(value.Topics, function(value, key) { 
 
       pageListElement = '<ion-item class="item-avatar-left energized item item-complex ionItemDisp" '+ 
 
       'id="page-list-item1" href="#" onclick="window.open(\'' + value.FirstURL + '\''+ 
 
       ', \'_system\', \'location=yes\'); return false;"><a class="item-content" ng-href="#" href="#">'+ 
 
       '<img src="' + value.Icon.URL + '"><h2energized>' + value.Text + '</h2energized>'+ 
 
       '</a></ion-item>'; 
 
       }); 
 
      } else if(value.FirstURL != undefined) { 
 
       pageListElement = '<ion-item class="item-avatar-left energized item item-complex ionItemDisp" '+ 
 
        'id="page-list-item1" href="#" onclick="window.open(\'' + value.FirstURL + '\''+ 
 
        ', \'_system\', \'location=yes\'); return false;"><a class="item-content" ng-href="#" href="#">'+ 
 
        '<img src="' + value.Icon.URL + '"><h2energized>' + value.Text + '</h2energized>'+ 
 
       '</a></ion-item>'; 
 
      } else { 
 
       alert("unhandled query"); 
 
      } 
 
      searchPageList.append(pageListElement); 
 
     
 
     }); 
 
     }). 
 
     error(function(data, status,headers, config) { 
 
     alert("Status is " + status); 
 
     }); 
 
    } 
 
})

私を助けてください。

+0

がinappbrowserプラグインを追加してみhttp://ngcordova.com/docs/plugins/inAppBrowser/ – rashidnk

答えて

1
window.open(‘url’, ‘_system’); 
//Loads in the system browser 
window.open(‘url’, ‘_blank’); 
//Loads in the InAppBrowser 
window.open(‘url’, ‘_blank’, ‘location=no’); 
//Loads in the InAppBrowser with no location bar 
window.open(‘url’, ‘_self’); 
//Loads in the Cordova web view 

詳細:https://wiki.apache.org/cordova/InAppBrowser

関連する問題