View Full Version : JAVASCRIPT support in ePub2/ePub3


Raja1205
09-01-2012, 08:01 AM
Hi,

I think that "iBooks" supports (limited support) JAVASCRIPT in ePub format files.

My question is as follows:

I have created a sample ePub with the following functionality:
-------------------------------------------------------------------
By default, Image display shows partial portion of the original image (like thumbnail image) and displays the full and original image after clicking that image.
-------------------------------------------------------------------

For the above sample, if first 2 pages contain images that works well in "iBooks" properly (i.e Original image displayed after clicking that thumbnail image) and the rest of the pages (which contains images) displays default image properly but after clicking that default image, it shows only white background without original image.

Is it iBook's Issue or JAVASCRIPT issue? (All images displays properly in all browsers)

Kindly advise how to solve this problem. Also advise if some other method available for the similar functionality.

I have attached a sample epub for your reference and hope the favorable response.


Thanks,
Raja. S

Toxaris
09-01-2012, 12:36 PM
Please be aware that javascript is not supported in ePUB2. iBooks might be able to work, but it is not a valid ePUB.

mrmikel
09-01-2012, 07:53 PM
The pictures can simply be linked to and from without using Javascript. I seem to recall you can't use a picture to link with, but you could certainly link using a caption.

Raja1205
09-03-2012, 04:24 AM
Hi Toxaris,

For your kind information,

From 'iBookstoreAssetGuide 4.8' - at page. 28:

---------------------------------------------
Note: iBooks supports scripting within version 2 EPUBs. iBooks does not support EPUB 3 at this time.
---------------------------------------------

Thanks,
Raja. S

Toxaris
09-03-2012, 05:14 AM
Yes, like I said iBooks supports Javascript. However, javascript is NOT ePUB2 specification. So, if Javascript is in an ePUB2, it is not a valid ePUB.
Please be aware that if an ePUB works in iBooks it is not a garantuee that it is valid. Apple seriously crippled the ePUB format in iBooks.

Raja1205
09-03-2012, 07:06 AM
No, 'iBookstoreAssetGuide 4.8' - at page. 28" states that iBooks supports Javascript within ePUB2 version and it's a valid ePUB. However, javascript is NOT ePUB2 specification.

DiapDealer
09-03-2012, 07:22 AM
Semantics.

mrmikel
09-03-2012, 07:48 AM
Including stuff that is not part of the specification can cause problems if someone tries to read the book in something other than an ibook. You could have extra blank spaces in the text, valid commands surrounding it that are ignored or other odd thing when you put in commands not part of the spec.
If it will always stay on ibooks, you can get away with it....until your boss tells you to make it accessible to a different device and you get to redo the whole thing!