如何在不使用activexobject的情况下在javascript中解压缩文件? [英] How to unzip a file in javascript without using activexobject?

查看:50
本文介绍了如何在不使用activexobject的情况下在javascript中解压缩文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<br />");
var url= $("Myfile.zip").val();



var donReading=function(zip){
    WithEntries(zip);
    
    };


var zipFile = new  ZipFile(url, doneReading);
};

function  WithEntries(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(var i=0;i<zip.entries.length;i++)    {
var entry=zip.entries[i];
var entryinfo= "<h4><a>" + entry.name + "</a></h4>\n<div>";

    }
}




script">





我尝试过:



此代码未执行。我想在不使用activexobject的情况下解压缩文件。

我该怎么办?



What I have tried:

This code is not getting executed. I want to unzip a file without using activexobject.
What should I do?

推荐答案

( Myfile.zip )。val();



var donReading = function(zip){
WithEntries(zip);

};


var zipFile = new ZipFile(url,doneReading);
};

函数WithEntries(zip){
("Myfile.zip").val(); var donReading=function(zip){ WithEntries(zip); }; var zipFile = new ZipFile(url, doneReading); }; function WithEntries(zip){


('#report')。accordion( 'destroy');

// clear
('#report').accordion('destroy'); // clear


( #report )。html('');
var extractCb = function(id){
//使用条目名称和条目文本$ b调用此回调$ b //在我的演示中,t他的文字只是注入手风琴小组。
return(function(entryName,entryText){
var content = entryText.replace(new RegExp(
\\\\
g ),< br /> );
("#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/>");


这篇关于如何在不使用activexobject的情况下在javascript中解压缩文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆