2016-07-30 79 views
0

我正在爲iOS和Android構建一個Cordova APP,它具有到外部網站的鏈接,但所有鏈接都在系統瀏覽器中打開,並且我想在APP中打開。Cordova 6.0外部鏈接

我的鏈接很簡單<a href="someURLlink">鏈接。我已經安裝了inappbrowser插件,但它似乎不起作用。

任何幫助或工作示例可以幫助我。

回答

0
var iab = cordova.InAppBrowser; 

iab.open('http://whitelisted-url.com');     // loads in the Cordova WebView 
iab.open('http://whitelisted-url.com', '_self');   // loads in the Cordova WebView 
iab.open('http://whitelisted-url.com', '_system');  // loads in the system browser 
iab.open('http://whitelisted-url.com', '_blank');  // loads in the InAppBrowser 
iab.open('http://whitelisted-url.com', 'random_string'); // loads in the InAppBrowser