Friday, June 17, 2011

Apple accepts Javascript in EPUB ebooks in iBookstore

Last night my photography ebook, “Barcelona Beyond Gaudí” was accepted into the iBookstore. While I'm personally very excited, I'm also professionally excited (!), since this means that Apple accepts Javascript in EPUB files for iBooks.

There is so much that Javascript will let us do in ebooks. Walrus Studio in Paris has an intriguing demo video showing text that can be revealed and blurred, and game points being added, erased, and tallied.

My own example is extremely simple and just uses Javascript to switch the stacking order of various elements so that full-page images can be either viewed on their own or with captions that contain descriptive information.

But the possibilities are endless. And the fact that Apple accepts them opens a very large door. It also gives EPUBs on iBooks another competitive advantage over EPUBs on other devices and Kindle books.

At first, I would think that this only affects non-fiction, but imagine if Cortázar had been able to write a Javascript-enabled novel!

(And a tiny aside. I was a bit worried about the accent in the title of my book—Yes, it's "gow-DEE" not "GOW-dy"—but, thankfully, searching on both Gaudí and Gaudi in the iBookstore and iTunes brings up my book.)

27 comments:

  1. Congrats, Liz, you're leading the charge!

    ReplyDelete
  2. Very nice, but in truth, expect Apple to stamp down on it in the end. Lots of nasty things can sneak through with Java.

    ReplyDelete
  3. Ninja Beaver, Java is not JavaScript.

    ReplyDelete
  4. Hm... interesting security implications depending on how the code executes, what external info/code it can call

    ReplyDelete
  5. What fun to see this!

    ReplyDelete
  6. It would be nice to see Apple document the iBooks.app more than it does at iTunes Connect. Hide and seek is fun once in a while but it gets old quickly.

    ReplyDelete
  7. Lovely book, Liz. And the integration via link to maps is smart and very nicely designed!

    May I as what the turnaround time was for approval?

    BTW, you can double press the home button to get a compact recent apps panel at the bottom of the screen, and thereby jump back into iBooks without first going to the home screen. (Slide that panel to the right to adjust volume and brightness, too.)

    Re security, current JavaScript in iBooks doesn't allow connections to outside servers, so thinking there isn't much risk.

    ReplyDelete
  8. Any suggestions on how to get a book in the iBookstore? I have an author/publisher friend that has been trying for some time.

    ReplyDelete
  9. @consultutah

    I know you weren't asking me, but if you use a service like Smashwords.com, they will distribute your book to all major ebook retailers, saving you an enormous amount of trouble for a very small percentage of your profit. It's what I'm doing, and I'm expecting my first novel to show up on iBookstore any day now.

    ReplyDelete
  10. V. Interesting, I have been looking at audio possibilities with regard to this, and the Amazon Kindle does not accept javascript:
    http://bitly.com/l25KyU

    ReplyDelete
  11. "… but imagine if Cortázar had been able to write a Javascript-enabled novel!"
    or as they say 'tales within tales'.

    ReplyDelete
  12. Ron: Thanks for your kind words. Turnaround was just over two weeks. And of course I should've thought of the multitasking bar. That's much better. Thanks for the reminder!

    ReplyDelete
  13. @consultutah What trouble has your friend had? My strategy is to make sure my books pass validation as well as the rules specified in the iBookstore Asset Guide (which you can download once you're a member of iTunes Connect)... things like, no images with text, no demos, no upsell links, etc.

    ReplyDelete
  14. I have mixed feelings about this. This isn't a new concept. Hypertext links within books can be useful, but disconnected active content in documents has had at best a spotty history. Hypercard was supposed to be a game changer. Scripts in PDF files have mostly served as a place to hide security holes. The only people who seem to have succeeded with it for any length of time are Infocom...

    ReplyDelete
  15. Liz, Congrats on your continued success with pushing the envelope. Javascript is one of the key additions to EPUB3 and I am happy to see Apple moving in that direction. A couple of questions: Was your book current EPUB with Javascript or EPUB3? Are you going to publish a new mini-guide?
    Eric Freese
    Aptara, Inc.
    http://www.aptaracorp.com

    ReplyDelete
  16. Thanks, Eric. My book is current EPUB with very simple Javascript. I have heard that there is a limit to what Apple will accept and it would be interesting to push those limits. I will be working on just that in the coming weeks. News here as I have some :)

    ReplyDelete
  17. Congrats! I'm still struggling to figure out what's wrong with my coding. I'm down to this final error message, which I can't find a single resource for online:

    ERROR ITMS-9000: "META-INF/container.xml in sample-photo-book-portrait.epub must contain one and only one root file reference." at Book (MZItmspBookPackage)

    My container.xml seems to have nothing wrong in it, with the standard rootfile:

    rootfile full-path="OEBPS/content.opf"
    media-type="application/oebps-package+xml" /

    Any idea what could possibly be wrong?

    ReplyDelete
  18. Liz, Many Congrats on your continued success. So would you like to share the concept of java-script which you have used in epub, and would we share a sample of any epub in which you have used java-script. It will be very useful for new learner like me.
    PS

    ReplyDelete
  19. Hi Liz,

    Thank you for this post and for all your excellent work on iBooks.

    Perhaps you could help answer a question. I'm new to iBook publishing and have not been able to find an answer anywhere. Is it possible to create promo codes to send to reviewers so they don't have to buy a book through the iBook Store? I know it's possible with apps, have not been able to find out whether it is for iBooks. Many thanks.

    ReplyDelete
  20. @Anonymous - contact Apple iBookstore with those questions. Preferably in non-anonymouse fashion ;-))

    @John - other than copyright issues, which are always a matter for negotiation, there's nothing to prevent an enterprising publisher from hypertextualizing e.g. the HopScotch. In fact, I have the seminal Ted Nelson's hyper-meta-urtext "Literary Machines" [1980, my ed. 1990] in both paper-, and in Macintosh (System 7?) hypertext form on a diskette (barely usable, alas, not an easy text to enhance using late 80s/ pre-Hypercard B/W technology… and the same could be said for Nelson's latest, 2009 self-published POD "Geeks Bearing Gifts" - internally just as chaotic as the earlier ones). Ah well, back to reality.

    As for Liz's Beyond-Gaudi ebook being accepted into Apple's iBookstore - I am slowly coming to an insight that if EPUB ever fails, it will be largely due to arcane commercial/ legacy regional demarcation laws, not because of the format's imperfections (which are legion). Ebook may have been accepted into the US/ Anglo-Saxon countries' iBookstores, but not elsewhere. I'm in EU, but not in the UK, and "my" iBookstore shelves basically are bare of anything current of interest. Once again, it's nothing to do with Liz, but that's how it doesn't work for the rest of us.

    ReplyDelete
  21. Thank you for your wonderful work! I have a basic question (and I plan to order your Audio and Video in ePub book shortly) - How much video can an iBook handle? Is there a size limit that Apple has established?

    ReplyDelete
  22. @Anon: The current limit is 2gb.

    ReplyDelete
  23. @Anonymous - I had the same question about how to issue promo-codes (coupons) to get review copies out to selected people. Here's what the iBookstore replied:

    Thank you for contacting iBookstore Support.
    Currently promotional codes are not distributed for books. We appreciate your feedback and will take this into consideration for future enhancements to iTunes Connect and the iBookstore.

    ReplyDelete
  24. Hi Liz,
    I am trying to find more information about the 2gb size limit. I haven't seen that size limit referenced anywhere else online - where did you discover that? And that is a limit to the size of the ENTIRE ebook., right?
    Thanks!
    Irene

    ReplyDelete
  25. @Irene: It's in Apple's iBookstore Asset Guide, which you can download from inside iTunes Connect. And yes, the 2gb refers to the entire file.

    ReplyDelete
  26. Great, we are just applying to iTunes Connect now so haven't downloaded the guide. Thanks!

    ReplyDelete
  27. Can you please explain me how to add javascript code in epub files?
    thanks in advance..

    ReplyDelete

More of my books