这是我的代码:
<script src="include/cordova.js" type="text/javascript"></script>
<script src="include/sencha-touch-all.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8" src="include/childbrowser.js"></script>
<link href="include/sencha-touch.css" rel="stylesheet" type="text/css" />
var childBrowser = null;
if (navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/)) {
document.addEventListener("deviceready", onDeviceReady, false);
} else {
onDeviceReady();
}
function onDeviceReady(){
console.log("PhoneGap is Ready");
childBrowser = ChildBrowser.install();
}
function openChildBrowser(url)
{
try {
//both of these should work...
var cb = new ChildBrowser();
console.log(cb);
cb.showWebPage('http://www.google.com');
}
catch (err)
{
alert(err);
console.log(err);
}
}
...
还有一些不相关的代码,但是当我打电话时,openChildBrowser()
我收到以下错误:
Uncaught TypeError: Object #<Object> has no method 'exec'
我相信这是指在对象上调用 exec 的子浏览器cordova
。
当我查看cordvoa
对象时,我在任何地方都看不到exec
功能......
有任何想法吗?