PhoneGap构建+ Cordova + ChildBrowser错误 [英] PhoneGap Build + Cordova + ChildBrowser Error

查看:85
本文介绍了PhoneGap构建+ Cordova + ChildBrowser错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码:

<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" />

<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()时,出现以下错误:

There is some more code that is unrelated but when I call openChildBrowser() I receive the following error:

Uncaught TypeError: Object #<Object> has no method 'exec' 我相信是在引用cordova对象上的子浏览器调用exec的参考.

Uncaught TypeError: Object #<Object> has no method 'exec' Which I believe is in reference to childbrowser calling exec on the cordova object.

当我查看cordvoa对象时,在任何地方都看不到exec函数...

When I look at the cordvoa object I don't see an exec function anywhere...

有什么想法吗?

推荐答案

我最终重新开始并使用了Eclipse和Phonegap SDK.能够以这种方式工作,而无需使用构建服务.

I ended up starting over and using Eclipse and the Phonegap SDK. Was able to get this working that way without using the build service.

这可能对某些人有帮助

http://phonegap.com/start#android

https://github.com/phonegap/phonegap-plugins/tree/master/Android/ChildBrowser

这篇关于PhoneGap构建+ Cordova + ChildBrowser错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆