当前位置: 动力学知识库 > 问答 > 编程问答 >

plugin seems to be undefined in cordova..!

问题描述:

I am currently working on cordova/phonegap,i have installed refreshgallary plugin from 'https://www.npmjs.com/package/cordova-plugin-refresh-gallery' but i am not getting it in 'window' object, it seems to be undefined every time.

under plugin www folder pluginRefresgGallary.js file code look like below(code is altered):-

cordova.define("Plugins/RefreshGalleryPlugin/", function (require, exports, module) {

var exec = require('cordova/exec');

// Plugin Refresh Gallery - Android

var RefreshMedia = function() {

};

RefreshMedia.prototype.refresh = function(url) {

exec(success, error, "PluginRefreshGallery", "refresh", [url]);

};

var success = function(success){

//alert("Success");

},

error = function(error){

//alert("Error");

};

window.refreshMedia = new RefreshMedia();

module.exports = refreshMedia;

})

before this i was getting an error called module isn't defined and i 'd defined module like above code error is solved but i'm not getting refreshGallry plugin into windows object.

Can anyone help me to solve this problem ???

网友答案:

This error happens sometimes when debugging, just dont care.

As I see in the plugin docs, it doesn't work into window object. Just call it refreshMedia into your javascript.

分享给朋友:
您可能感兴趣的文章:
随机阅读: