![]() |
Viewer seems not to load some scripts
3 Attachment(s)
The attached epub makes use of javascripts to achieve certain text effects with a minimum of html markup (all the work is made on the css stylesheet). The epub is perfectly displayed by the Calibre Book Editor, as you can see in the image below:
Attachment 189070 However, the Calibre book viewer only displays text without any formatting: Attachment 189071 Obviously the Book Viewer is not loading the javascripts and, I wonder why? I have included the keyword "defer" in the script tags but without result. It also doesn't work to move the scripts to the bottom of the page (above the </body> tag). I would like to know if all this is because I am doing something wrong, or because of a bug in the book viewer. Regards |
1 Attachment(s)
Quote:
The fact that JavaScript can work on an E-reader does not mean that all (combinations) of HTML, CSS and JavaScript code can also work in all E-readers and EPUB apps. In addition, for example, Google Play Books does not allow JavaScript and Javascript must be allowed on the E-reader. I don't think the problem is the JavaScript not loading, but the EPUB render software version not being recognized. To make your EPUB work properly in PageEdit I've put a webkit class over the HTML on both chapters to make it work: Code:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class=" -webkit-">Regards MicroDrie |
Quote:
I appreciate your answer. What version of PageEdit are you using? Because I can open the posted epub on PageEdit without adding the "-webkit-" class. In fact, the script prefixfree.min.js is precisely for that; to avoid using any prefix (the script according to the ereader, adds the proper prefix [-moz, -ms, -webkit] to whatever -headers, styles, etc.). Quote:
Regards to you too. Rubén |
In order to work in web browsers, the viewer virtualizes loading of scripts, so their load order is no longer preserved. If you right click and open the inspector in the console you will see an error about jQuery not being defined. You can fix it by wrapping the entire ntheverything code to run only on the load event.
|
| All times are GMT -4. The time now is 09:32 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.