การเรียกเวปภายนอก app
URLs with IonicFramework
https://blog.nraboy.com/2014/07/launch-external-urls-ionicframework/
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git
<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>
Code | Description |
---|---|
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 |
ไม่มีความคิดเห็น:
แสดงความคิดเห็น