我有一个网站,我用jQuery和HTML5编码。我想使用一个简单的框架为IOS和Android,我的网站加载到应用程序 - 本质上是一个内部浏览器。点击应用程序中的链接将转到应用程序中的该远程页面。
I have a website that I've coded with jQuery and HTML5. I'd like to use a simple framework for IOS and Android that loads my website into the app - essentially an internal browser. Clicking on a link in the app would go to to that remote page inside the app.
我已经尝试使用Cordova在index.html上设置位置,外部网站进入设备浏览器而不是应用:
I've tried setting a location on index.html using Cordova but it's loading the external site into the device browser and not the app:
<html lang="us"> <head> <meta charset="utf-8"> <title>Test</title> <script src="cordova.js"></script> <script type="text/javascript"> document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { // Now safe to use the Codova API window.location="www.test"; } </script> </head> <body> </body> </html>如何使用Cordova加载远程站点,所以应用程序本质上是一个Web浏览器?
How can I load my remote site with Cordova so the app is essentially a web browser? Is there a better/easier solution other than Cordova to accompolish this?
推荐答案安装在应用程序浏览器中
Install In App browser
cordova plugin add cordova-plugin-inappbrowser然后在代码中
var options = { location: 'yes', clearcache: 'yes', toolbar: 'no' }; $cordovaInAppBrowser.open('yoururlhere', '_blank', options)有关详情,请参阅 appova中的cordova文档
更多推荐
Cordova将远程站点加载到应用程序中
发布评论