Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $j('#something').html('fetching');
- $j.ajax({
- url: '/path/to/epub.epub',
- complete: function(response, status, request) {
- var the_zip = new JSUnzip(response.responseText);
- $j('#something').html('finished with ' + status);
- console.log("is it zip?" + the_zip.isZipFile());
- var epub = new JSEpub(response.responseText);
- epub.processInSteps(function (step, extras) {
- var msg = '';
- console.log(step);
- if (step === 1) {
- msg = "Unzipping";
- } else if (step === 2) {
- msg = "Uncompressing " + extras;
- } else if (step === 3) {
- msg = "Reading OPF";
- } else if (step === 4) {
- msg = "Post processing";
- } else if (step === 5) {
- msg = "Finishing";
- alert('done!');
- } else {
- msg = "Error!";
- }
- $j('#something').html(msg);
- });
- }
- });
Add Comment
Please, Sign In to add comment