Giter VIP home page Giter VIP logo

Comments (9)

MC2013 avatar MC2013 commented on August 26, 2024

The html code looks like this:

<title></title>
    <link rel="stylesheet" href="css/normalize.css">
    <link rel="stylesheet" href="css/main.css">
    <link rel="stylesheet" href="css/popup.css">

    <script src="js/libs/jquery-1.9.0.min.js"></script>

    <script src="js/libs/zip.min.js"></script>        


    <script>
        "use strict";

        document.onreadystatechange = function () {  
          if (document.readyState == "complete") {
            EPUBJS.VERSION = "0.1.6";

            EPUBJS.filePath = "js/libs/";
            zip.workerScriptsPath = "js/libs/";
            EPUBJS.cssPath = "css/";
            fileStorage.filePath = EPUBJS.filePath;
            EPUBJSR.app.init("epub/10_Questions_Every_Christian_Must_Answer_Alex_McFarland.epub");
          }  
        };

    </script>

    <!-- Render -->
    <script src="js/epub.min.js"></script>

    <!-- Zip JS -->
    <script src="js/libs/zip.min.js"></script>

    <!-- Hooks -->
    <script async src="js/hooks.min.js"></script>

    <!-- Reader -->
    <script src="js/reader.min.js"></script>

    <!-- fileStorage -->
    <script src="js/libs/fileStorage.min.js"></script>

</head>
<body>
    <div id="sidebar">
      <div id="controls">

        <!-- <input id="search" placeholder="search"> -->
        <a id="network"><img id="store" src="img/save.png"></a>
        <a id="setting"><img id="settings" src="img/settings.png"></a>
        <a id="bookmark"><img id="bookmarks" src="img/star.png"></a>
      </div>
      <div id="toc">
      </div>
      <div id="settingsPanel">
      </div>

    </div>
    <div id="main">
      <div id="opener">
        <a id="open"><img src="img/menu-icon.png"></a>
      </div>
      <div id="titlebar">
        <span id="book-title"></span>
        <span id="title-seperator">&nbsp;&nbsp;–&nbsp;&nbsp;</span>
        <span id="chapter-title"> </span>
      </div>
      <div id="divider"></div>
      <div id="prev" class="arrow">‹</div>
      <div id="area"></div>
      <div id="next" class="arrow">›</div>
      <div id="loader"><img src="img/loader.gif"></div>
    </div>
</body>

from epub.js.

the-frey avatar the-frey commented on August 26, 2024

Are you getting anything logged to the console when loading hangs?

from epub.js.

MC2013 avatar MC2013 commented on August 26, 2024

Thanks for replying to my query. No, nothing gets logged to the console in the process... do you have any suggestions I could try?

(I assume that if the scripts work offline, it should work online when uploaded to the server)

from epub.js.

fchasen avatar fchasen commented on August 26, 2024

I'd suggest trying opening the book in

examples/basic-dev.html

The code is uncompressed and should giver better errors.

It's possible the the server you are using doesn't implement http chunking which zip.js uses to read the epub file.
It should fall back and work normally, but maybe it isn't.

Could you test with a unzipped version of the epub and see if anything is displayed?

from epub.js.

MC2013 avatar MC2013 commented on August 26, 2024

I uploaded the package to the server and tried using basic-dev.html. Mobi-dick/ content does not load up.
I tried your suggestion using an unzipped version of other epub ebooks, but nothing loads. I just see a blank page with the controls.
The hosting server I am using is windows based and apparently does not allow modifications of files by the public. So I think you maybe right that chunking may not be working because of this.

What I don't get is that I never got the basic-dev.html to work locally either , whether it's with unzipped or zipped files

from epub.js.

AJRenold avatar AJRenold commented on August 26, 2024

If you're running this on a server do you have a url (or could you make a temporary url) so that we could help you debug?

If the controls are loading, then Epub.js might be having issues opening your book or fetching the resources from the unzipped Epub. In your browsers developer tools, you should look at the network calls to see if epub.js is failing to get the epub file resources. This could be because your server is not allowing GET requests to access the contents of that directory (e.g. similar to getting a static/js static/css static/html or other resource type).

Also one thing that has helped me debug this, has been checking if the Table of Contents is loading or not.

from epub.js.

MC2013 avatar MC2013 commented on August 26, 2024

@AJRenold and @fchasen Thanks for the suggestions.
I have uploaded the epub.js package to the server and the link to basic-dev.html is:
http://www.ecac.ca/emc/resources/epub.js/examples/basic-dev.html

The script is pointing to:
<script>
"use strict";

        var Book = ePub("../demo/moby-dick/", {restore: true, reload: false });

    </script>

I only get a blank page at this point. I would greatly appreciate any further pointers as to what I am doing wrong or where the problem might be.

from epub.js.

MC2013 avatar MC2013 commented on August 26, 2024

I figured out where the problem was. It's the server not having a specified MIME type for ".epub" files and so it does not know how to 'treat' it. I went under "user-configurable IIS settings" in IIs Administration Console and custom assigned ".epub" to "application/epub+zip" MIME type. The epub files are working now with the script above.

Thanks you guys for your help.

from epub.js.

fchasen avatar fchasen commented on August 26, 2024

Great, will update the readme to reflect this.

from epub.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.