It’s been known for a while that iBooks supports JavaScript on its ePub files, albeit without any technical documentation whatsoever to date.
Yet when we started experimenting with JavaScript within iBooks, we couldn’t find any open-source working examples. So we created one.
JQuery Hello World is a bare-bones ePub that shows a Hello World alert using JQuery. Not only it shows that JavaScript is supported within iBooks, but also that complex libraries like JQuery might be used.
Both the ePub file and the source code are available in our github account. Make sure you update to the latest iBooks version before trying it.
Happy coding! We will be publishing more iBooks ePub experiments shortly.
Something seems wrong with the ePub download itself. GitHub says “there is an error”
No, it’s just that GitHub doesn’t know how to handle an ePub file.
The quickest way to download it is to click on the big Download button on top. Or click here:
https://github.com/robotmedia/iBooks-ePub-Samples/zipball/master
Hope that helps!
Here are also examples!
* jQuery
http://www.sunbi.co.jp/category/epub/index.htm#jquery
* Zept.js
http://www.sunbi.co.jp/category/epub/index.htm#zepto
does iBooks let you embed javascript code that talks to the server (e.g ajax, jsonp calls) ?
yeah does anyone have a working example of javascript talking to a server?