2 title: "Get a file with an ajax call"
7 <p>Tip : check the source of the page !</p>
9 <h3>With JSZipUtils</h3>
10 <div id="jszip_utils"></div>
12 <script type="text/javascript">
15 function showError(elt, err) {
16 elt.innerHTML = "<p class='alert alert-danger'>" + err + "</p>";
19 function showContent(elt, type, content) {
20 elt.innerHTML = "<p class='alert alert-success'>loaded ! (as a " + type + ")<br/>" +
21 "Content = " + content + "</p>";
24 //=========================
26 //=========================
27 JSZipUtils.getBinaryContent('{{site.baseurl}}/test/ref/text.zip', function(err, data) {
28 var elt = document.getElementById('jszip_utils');
35 var zip = new JSZip(data);
36 showContent(elt, "" + data, zip.file("Hello.txt").asText());