2016-02-24 55 views
0

我目前正在研究cordova/phonegap,我已经安装了来自'https://www.npmjs.com/package/cordova-plugin-refresh-gallery'的refreshgallary插件,但我没有在'window'对象中找到它,每次都似乎没有定义。 下插件WWW文件夹pluginRefresgGallary.js文件代码看起来像下面(代码被改变): -插件似乎是在科尔多瓦未定义..!

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

此我是越来越称为模块错误之前没有定义,并且我想上面的代码错误定义的模块解决了,但我没有得到refreshGallry插入Windows对象。

任何人都可以帮助我解决这个问题?

回答

0

这个错误有时在调试时发生,只是不在乎。

正如我在插件文档中看到的,它不适用于窗口对象。只需将它称为refreshMedia到您的JavaScript。

+0

嗨,感谢您的帮助,但是当我直接调用它似乎是未定义的。 –

+0

是否有任何代码来刷新文件管理器路径? –

相关问题