2016-02-21 45 views
2

我剛剛創建了Phonegap/Android應用程序,但似乎無法在任何瀏覽器中打開任何網站。我試圖在應用程序內以及應用程序外部打開瀏覽器 - 仍然沒有運氣。此外,我嘗試了其他人推薦的每個片段,但當點擊鏈接時仍然沒有任何反應。這是我曾嘗試:如何在phonegap應用程序之外打開網址url

1)我嘗試添加以下到我的config.xml文件:

<gap:plugin name="org.apache.cordova.inappbrowser" /> 

then adding this to my index.html file: 
<a onclick="navigator.app.loadUrl('https://google.com/', { openExternal:true });">Link</a> 

2)我的下一個嘗試是想:

<a onclick='window.open("http://google.com","_system", "location=yes")' href='javascript:void(0)' >Link</a> 

有誰知道我做錯了什麼?

回答

0

哪個版本的cordova r使用??如果使用上面3.3.0 UR,那麼你應該如下在config.xml文件使用權限..

<access origin="http://your domain name/*" launch-external="yes" /> 
相關問題