0

Flarum是一款新时代的论坛软件,它拥有一款出色的移动网络应用程序,可在iOS/Android的Chrome浏览器中工作得非常出色。它有很多功能,如滑动讨论,攻击等答复等将外部手机网站加载到Ionic的InAppBrowser中

我的目标是加载从Ionic混合应用程序相同的移动Web应用程序。我尝试从iFrame加载移动web应用程序的第一件事。这造成了很多问题。最初这个页面甚至不会滚动,只有在几次认真的google-fu之后才能让滚动工作,那也是非常不稳定的。

然后我开始看ngCordova的InAppBrowser。问题是我似乎无法获得与在iOS/Android中从Chrome加载它相同的功能。滚动工作正常,但其他功能缺失,即滑动讨论和其他许多事情。

这是Ionic/ngCordova中的限制,还是我应该看一下?我已经看过文档,并按照here的步骤

任何提示,指针或示例应用程序将不胜感激。谢谢 !

tl; dr:我想从Ionic ngCordova的InAppBrowser加载一个移动网站,但可以获得与从移动设备上的chrome/safari加载它相同的功能。

回答

1

JS

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

HTML

<ion-view title="Test Page"> 
    <ion-content> 
     <div class="list"> 
      <a class="item" href="#" onclick="window.open('http://www.nraboy.com/contact', '_system', 'location=yes'); return false;"> 
       Open a Browser 
      </a> 
      <a class="item" href="#" onclick="window.open('http://www.twitter.com/nraboy', '_system', 'location=yes'); return false;"> 
       Open a Twitter Client or Browser 
      </a> 
      <a class="item" href="#" onclick="window.open('https://plus.google.com/+NicRaboy', '_system', 'location=yes'); return false;"> 
       Open a Google+ Client or Browser 
      </a> 
     </div> 
    </ion-content> 
</ion-view> 

来源https://www.thepolyglotdeveloper.com/2014/07/launch-external-urls-ionicframework/

+0

拉吉嗨,感谢您的努力。当我四处寻找答案时,我遇到了这个问题。不幸的是,这似乎不能解决问题,尽管我再次尝试了这一点。没有得到它在iOS模拟器或我的手机上工作。 我觉得解决方案可能(可能)与ngCordova(Ionic实现Cordova的库)有关。 –

+0

是的,你将不得不包括ngcordova.js –