这是我的 downloader.js 文件内容:
function Downloader() {}
Downloader.prototype.downloadFile = function(fileUrl,dirName,fileName,overwrite,win,fail) {
//Make params hash optional.
if (!fail) win = params;
PhoneGap.exec(win, fail, "Downloader", "downloadFile", [fileUrl, params]);
};
PhoneGap.addConstructor(function() {
PhoneGap.addPlugin("downloader", new Downloader());
PluginManager.addService("Downloader", "com.phonegap.plugins.downloader.Downloader");
});
我已将此集成到 android 项目中。但是当我运行该项目时,我得到了Uncaught ReferenceError: PhoneGap is not defined at file:///android_asset/www/js/downloader.js:10
。谁能告诉可能是什么问题。