Created
April 11, 2011 19:42
-
-
Save Stuk/914161 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>title</title> | |
</head> | |
<body> | |
<script type="text/javascript" src="jszip.js"></script> | |
<script type="text/javascript" src="jszip-deflate.js"></script> | |
<script type="text/javascript" src="test.js"></script> | |
<input type="button" value="a" onclick="a()" /> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function a() { | |
var zip = new JSZip("DEFLATE"); | |
zip.add("test.html", '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">\n'+ | |
'\n'+ | |
'<head> <title>DraftZIPFiles</title> <script src="../lively/bootstrap.js"></script><meta id="WorldChangeSet"><code xmlns="http://www.w3'); | |
content = zip.generate(); | |
location.href="data:application/zip;base64,"+content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment