rschroll / efm

Epub for Monocle — A pure javascript implementation of the book data interface for Epub2 and Epub3
http://rschroll.github.com/efm
44 stars 15 forks source link

help me to work with blob for epub in efm #4

Closed KogBasetti closed 11 years ago

KogBasetti commented 11 years ago

I have written this code to load .epub file url, but its now working. Is any error in this code.

Please help

    $(document).ready(function () {
    var xhr = new XMLHttpRequest();
        var src = 'Epubfiles/childrens-literature-20130206.epub';
        xhr.open('GET', src, true);
        xhr.setRequestHeader('Content-Type', 'epub+zip');

        var bb = new (window.BlobBuilder || window.WebKitBlobBuilder)();
        bb.append(xhr.responseText);
        var blob = bb.getBlob("application/epub+zip");

        var saveas = document.createElement("iframe");
        saveas.src = window.webkitURL.createObjectURL(blob);
       document.body.appendChild(saveas);

 // i have tried this code to 
       // new Epub(blob, createReader); 

    });

I don't even know much more of .epub structure and the content type.

rschroll commented 11 years ago

Please stop opening new issues on this subject. All discussion should go in #2.