Basic JavaScript Support

3 posts / 0 new
Last post

I've created an Epub3 book which uses JavaScript to resize text. It does not use jQuery, just native JavaScript. The resizing works in Calibre's book viewer but in the Kindle emulator for Kindle Fire the JavaScript is entirely ignored. Where can I find information about what is allowed and what is not allowed? It doesn't seem right that such simple functionality is not standard for a device that is doing nothing more than dumbed down web rendering.

When will JavaScript become standard? What devices allow JavaScript? Are there workarounds to get your scripts to run? Basically, what is the whole happenings with JavaScript right now and epub3?

Amazon devices do not interpret EPUB at all.
KF8 ist more or less a pessimised clone of EPUB3 with some proprietary compression/encryption and some restrictions and simplifications (and bugs in the Amazon viewers compared to their description of KF8).
In EPUB 3 JavaScript is possible, but authors always have to ensure, that the content is accessible completely, if no script interpreation is available.
This fits to the layer concept (content as XHTML/SVG, decoration with CSS, decorative changes with scripting, but content has to be accessible without decoration or scripting independently).
The Amazon devices do not have any scripting.

This describes roughly the proprietary Amazon format KF8, respectively how to pessimise an EPUB to be able to use KindleGen to generate some Amazon-book:

The text is accessible and stand alone. The JavaScript is only used to change the font-size. But not even this is the problem by itself. On different Kindle devices the CSS styles are disregarded. Simple positioning like "position: relative;" are thrown out entirely.

What devices support JavaScript?

And also, what is the point? If eReaders do not allow for even CSS to occur then how would one ever gain dynamic styling? The eReaders are so different from one another that it doesn't make it possible for modular design in the first place. This is a serious problem. eReaders need to synchronize to some standard to allow eBooks to do their thing across all devices.

It's not like "oh in order to get it to work across all devices I just need to code it correctly." No, you can code up a dynamic web page across all browsers but then this can't be worked with at all. There is actually only "one" way to do it and that is the reflowable option which strips the book experience completely from the text. The whole thing is way too dumb and dumbed down.

Secondary menu