3

我正在进行的项目涉及通过 document.location.href 立即将控制权从 iOS phonegap 传递到外部主机(尽管使用缓存清单,所以不完全是外部的),然后访问(缓存的)外部 javascript 中的所有 phonegap 的好东西。

在 iOS 6 和 phonegap 2.1.0 之前,这工作正常。自从我升级后,我注意到的第一件事是控制台日志不再传递给 Xcode。我使用 ./create 创建了一个新项目,并将新的 cordova-2.1.0.js(也尝试使用 cordova.ios.js)复制到我的外部内容的 javascript 文件夹中。然后我将我的外部 index.html 剥离为简单

<!DOCTYPE html>
<html>
    <head>
        <script src="js/lib/phonegap/cordova-2.1.0.js"></script>
    </head>
    <body>
        <button type='button' onclick='console.log("huf")'>click</button>       
    </body>
</html>

我已确保我的所有路径都是正确的(在 javascript 中测试是否存在科尔多瓦通行证)。在将控制权传递给外部主机之前,控制台日志记录工作正常。

Xcode 中不显示控制台日志。

有人有什么想法吗?

4

1 回答 1

1

I just tried and for me it work. iPad 3 with iOS6 + PhoneGap 2.1.0 XCode 4.5.1

Are you sure the library loaded correctly? IT might be a good idea to add an ondeviceready event listener and put the logging in there. Also add an alert in there too so you know that your event fired.

于 2012-10-22T21:15:02.433 回答