Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic window.open is not working in ios device

I have simply window.open(), user will search any thing in text field and will click on suggest link, so result will be open in device browser. My code is working fine in system browser(chrome) and in android device but in ios device its not working. Have a look of my code below .

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);
      });
    }
})

Please help me .

like image 299
Abhay Sharma Avatar asked May 26 '16 08:05

Abhay Sharma


1 Answers

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 

more info: https://wiki.apache.org/cordova/InAppBrowser

like image 182
Sinandro Avatar answered Sep 24 '22 20:09

Sinandro