这是 phonegap 主文件www/index.html 我想像本地应用程序一样加载我的网站,脚本:
//var ref = cordova.InAppBrowser.open('http://website.com/page/index.php', '_self', 'location=no');
document.addEventListener("deviceready", function(){
window.open = cordova.InAppBrowser.open('http://website.com/page/index.php', '_self', 'location=no');
},true);
</script>
我的 phonegap config.xml文件
<plugin name="cordova-plugin-inappbrowser" source="npm" spec="~1.3.0" />
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
我的网站也在所有页面中启用
header('Access-Control-Allow-Origin: *');
脚本中的网站根本不是我的网站,因为我在本地主机上运行它,我用手机浏览器在同一网络中测试了网站,它工作得很好,但是当我尝试通过手机间隙应用程序加载时,它显示空白页面