【发布时间】:2012-11-01 11:06:19
【问题描述】:
这是我的 HelloPlugin.js 文件。
var HelloPlugin = {
callNativeFunction: function(success,fail,resultType) {
return cordova.exec(success, fail, "HelloPlugin", "nativeAction", [resultType]);
}
};
我收到以下异常:
: Uncaught ReferenceError: cordova is not defined at file:///android_asset/www/HelloPlugin.js:3
提前谢谢你。
【问题讨论】:
-
将 cordove.js 添加到您的代码中
-
cordova.js 不是我的文件。它是我复制到 www/assets 文件夹的 PhoneGap 文件
-
添加这一行