Uncaught ReferenceError: PhoneGap n'est pas définie dans le fichier

c'est mon downloader.js le contenu du fichier:

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");
});

J'ai intégré dans le projet android.Mais quand je lance le projet , je reçois Uncaught ReferenceError: PhoneGap is not defined at file:///android_asset/www/js/downloader.js:10. Si quelqu'un peut dire quel pourrait être le problème.

  • avez-vous inclus phonegap.js correctement?? elle devrait être définie au-dessus de la downloader.js fichier
  • J'ai inclus cordova-1.8.1.js. Je n'ai pas phonegap.js fichier..Où pourrais-je obtenir ce
  • cordova.js aussi crée une variable PhoneGap, assurez-vous cordova.js est inclus avant la downloader.js fichier dans votre fichier html
  • Hey merci Cela a fonctionné..
  • j'ai mis que dans la réponse de sorte que vous pouvez accepter la réponse
InformationsquelleAutor Ekta Shukla | 2012-07-06