Jquery PhoneGap应用程序在页面加载时加载内部浏览器

Jquery PhoneGap应用程序在页面加载时加载内部浏览器,jquery,cordova,phonegap-plugins,Jquery,Cordova,Phonegap Plugins,我正在为droid创建一个带有PHonegap构建服务的简单包装器,它将显示flash,然后启动到该站点的移动版本中 我尝试过各种组合,到目前为止,以下组合效果最好: <!doctype html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width" /> <title>My App&l

我正在为droid创建一个带有PHonegap构建服务的简单包装器,它将显示flash,然后启动到该站点的移动版本中

我尝试过各种组合,到目前为止,以下组合效果最好:

<!doctype html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width" />
<title>My App</title>
<link rel="stylesheet" href="assets/css/master.css" type="text/css" media="screen" />
<script src="phonegap.js" type="text/javascript" charset="utf-8"></script>
<script src="cordova-2.1.0.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8" src="json2.js"></script>
<script src="childbrowser.js" type="text/javascript" charset="utf-8"></script>
<script src="assets/js/dsl.js" type="text/javascript" charset="utf-8"></script>
<script src="assets/js/xui.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">

function init(){
document.addEventListener("deviceready", onDeviceReady, false);
}

function externalLoad() 
{ 
window.location.href = "http://myapp.com"; //works
}

function locationChanged(newurl) {
console.log("The JS got this url = " + newurl);
}

function closed() {
console.log("The JS got a close event");
}
function showPage(locbar) {
window.plugins.childBrowser.onLocationChange = locationChanged;
window.plugins.childBrowser.onClose = closed;
window.plugins.childBrowser.showWebPage("http://myapp.com", {
showLocationBar: locbar
});
}
 function openExternal() {
 window.plugins.childBrowser.openExternal("http://myapp.com");
}

</script>       

</head>
<body onLoad="externalLoad();">
<button onClick="externalLoad() ;">Load Deals</button> <br>
</body>
</html>
上述操作非常有效,只是它在应用程序web视图中打开了应用程序,我无法访问我需要的设备浏览器cookie

我尝试过使用childbrowser插件,它工作得很好,但我无法在加载页面时启动它。如果点击了链接,它就可以正常工作

我一定错过了什么,因为这看起来应该很容易做到


任何正确方向的建议或帮助都将不胜感激。

本机cookie与真实cookie的实现方式可能有所不同。一种解决方法是打开一个特殊页面,参数中包含cookie值。在真正的浏览器中设置cookie并重定向到主页或任何需要的地方。这是一点工作,但它保证在任何条件下都能工作

本机cookie与真实cookie的实现方式可能不同。一种解决方法是打开一个特殊页面,参数中包含cookie值。在真正的浏览器中设置cookie并重定向到主页或任何需要的地方。这是一点工作,但它保证在任何条件下都能工作