3
我想将文件(图像)存储在我的Cordova(3.6.4)应用程序中,该应用程序使用RequireJS构建。Cordova + RequireJS:如何加载文件插件
我做了一个新模块,但我不知道如何使用RequireJS加载File-Plugin(org.apache.cordova.file)。 window.requestFileSystem始终未定义。我以为我必须加载文件系统(如在模块中评论),但没有任何工作...
define(function (require) {
"use strict";
var $ = require('jquery'),
//FileSystem = require('/plugins/org.apache.cordova.file/www/FileSystem'),
download = function (URL, Folder_Name, File_Name) {
//step to request a file system
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, fileSystemSuccess, fileSystemFail);
},
return {
download: download
};
});
请问您可以发布您的整个代码。你是如何解决这个问题的?请详细说明 – 2016-11-20 06:22:34
我对您的解决方案也很感兴趣:如果手动包含插件文件,我会收到错误消息,但如果我只包含cordova文件,则会出错。 – mix3d 2017-04-04 14:53:48