Javascript android中phonegap 2.3或更高版本的解压缩插件?
我正在搜索一个适用于android的phonegap 2.3插件,它可以解压文件夹。我发现 但是它只在phonegap 1.3中工作,并且只解压缩了文件的一半。我有一个包含50 60个html文件的zip文件夹。但它只提取5到10个文件并返回“IO错误”。请帮助我找到适用于PhoneGap 2.3或更高版本的android解压插件 我编辑了这个插件,你也可以从 [编辑](答案已更改) 临时的替代方法是使用JavaScript。 这是密码-Javascript android中phonegap 2.3或更高版本的解压缩插件?,javascript,android,cordova,phonegap-plugins,Javascript,Android,Cordova,Phonegap Plugins,我正在搜索一个适用于android的phonegap 2.3插件,它可以解压文件夹。我发现 但是它只在phonegap 1.3中工作,并且只解压缩了文件的一半。我有一个包含50 60个html文件的zip文件夹。但它只提取5到10个文件并返回“IO错误”。请帮助我找到适用于PhoneGap 2.3或更高版本的android解压插件 我编辑了这个插件,你也可以从 [编辑](答案已更改) 临时的替代方法是使用JavaScript。 这是密码- var readFile = function(){
var readFile = function(){
$("#status").html("<br/>");
var url= $("#urlToLoad").val();
var doneReading = function(zip){
extractEntries(zip);
};
var zipFile = new ZipFile(url, doneReading);
};
// this function extracts the entries from an instantiated zip
function extractEntries(zip){
$('#report').accordion('destroy');
// clear
$("#report").html('');
var extractCb = function(id) {
// this callback is invoked with the entry name, and entry text
// in my demo, the text is just injected into an accordion panel.
return (function(entryName, entryText){
var content = entryText.replace(new RegExp( "\\n", "g" ), "<br/>");
$("#"+id).html(content);
$("#status").append("extract cb, entry(" + entryName + ") id(" + id + ")<br/>");
$('#report').accordion('destroy');
$('#report').accordion({collapsible:true, active:false});
});
}
// for each entry in the zip, extract it.
for (var i=0; i<zip.entries.length; i++) {
var entry = zip.entries[i];
var entryInfo = "<h4><a>" + entry.name + "</a></h4>\n<div>";
// contrive an id for the entry, make it unique
var randomId = "id-"+ Math.floor((Math.random() * 1000000000));
entryInfo += "<span class='inputDiv'><h4>Content:</h4><span id='" + randomId +
"'></span></span></div>\n";
// insert the info for one entry as the last child within the report div
$("#report").append(entryInfo);
// extract asynchronously
entry.extract(extractCb(randomId));
}
}
var readFile=function(){
$(“#status”).html(“
”);
var url=$(“#urltoad”).val();
var donerereading=函数(zip){
抽签(zip);
};
var zipFile=新的zipFile(url,doneReading);
};
//此函数用于从实例化的zip文件中提取条目
函数提取条目(zip){
$('报告')。手风琴('销毁');
//清楚的
$(“#报告”).html(“”);
var extractCb=函数(id){
//使用条目名称和条目文本调用此回调
//在我的演示中,文本只是注入到手风琴面板中。
返回(函数(entryName、entryText){
var content=entryText.replace(新的RegExp(“\\n”,“g”),“
”;
$(“#”+id).html(内容);
$(“#status”).append(“提取cb,条目(“+entryName+”)id(“+id+”)
);
$('报告')。手风琴('销毁');
$(“#报告”).accordion({可折叠:真,活动:假});
});
}
//对于zip中的每个条目,将其解压缩。
对于(var i=0;ibro我在1.3中使用了这个插件,但它不起作用。i,e文件夹很好,但我有100个zip文件。这不是一个zipAre文件夹,你的目标是Android?或iOS?或每个平台?你愿意尝试JavaScript吗?我可能会在这里发布我在后端有php moodle。这会非常长。我需要太多的错误。)或者免费脚本,因为我正在开发电子学习应用程序bro.Oops!这可能真的很难!好的,我会尽快告诉你的!:)编辑了那个插件