4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5 <title>JSZip example : download the generated zip file</title>
7 <link media="screen" href="style.css" type="text/css" rel="stylesheet">
9 <script type="text/javascript" src="../jszip.js"></script>
10 <script type="text/javascript">
11 window.onload = function () {
12 var zip = new JSZip();
13 zip.file("Hello.txt", "Hello world\n");
16 document.getElementById('data_uri').href = "data:application/zip;base64," + zip.generate();
19 var blobLink = document.getElementById('blob');
21 blobLink.download = "hello.zip";
22 blobLink.href = window.URL.createObjectURL(zip.generate({type:"blob"}));
24 blobLink.innerHTML += " (not supported on this browser)";
30 <h1><a href="../">JSZip</a> example : download the generated zip file</h1>
31 <p>Tip : check the source of the page !</p>
34 <a href="#" id="data_uri">click to download</a>
38 <a href="#" id="blob">click to download</a>