我在哪里可以找到 cordova.js?

2022-01-25 00:00:00 include javascript cordova

我正在使用 HTML5、Javascript 和 CSS3 编写移动应用程序.我正在使用phonegap.

I'm writing a mobile app with HTML5, Javascript and CSS3. I'm using phonegap.

所以如果我使用这样的东西.

So if I use something like this.

document.addEventListener("deviceready", onDeviceReady, false);

function onDeviceReady() {
    document.addEventListener("backbutton", onBackKeyDown, false);
}

function onBackKeyDown() {
    alert("test");
}

我收到此错误:

cordova :您的项目中必须包含cordova.js,才能触发事件.

cordova : You must have cordova.js included in your projects, to be able to trigger events.

我正在使用 Ripple 来模拟智能手机.它是正确的.我的项目文件夹中没有 cordova.js,因为我不知道从哪里得到它.我已经下载了 phonegap 的最新版本 2.9.0,并特别使用了 cordova-mobile-spec.

I'm using Ripple to emulate a smartphone. And its right. I don't have cordova.js in my project folder, because I don't know where i get it. I have downloaded the newest version 2.9.0 of phonegap and using specially cordova-mobile-spec.

没有 cordova.js,只有 cordova-incl.js.如何获取此文件?

There is no cordova.js just a cordova-incl.js. How do I obtain this file?

推荐答案

检查新建项目中的cordova.js(使用命令行)

Check the cordova.js inside the new project created (by using command line)

在下载的 CORDOVA ZIP 文件中检查您的 LIB 文件夹

CHECK YOUR LIB FOLDE INSIDE THE DOWNLOADED CORDOVA ZIP FILE

对于 IOS 检查 cordovalib 文件夹

FOR IOS CHECK cordovalib folder

安卓

请检查每个平台的 libs 文件夹.

Please check libs folder of each platform.

相关文章