-
All replies
-
Helpful answers
-
Aug 23, 2012 3:55 AM in response to alexnolasby MichiHenning,Have you tried local storage? That one persists even if you navigate away from a widget, and it persists across stopping and re-starting iBooks.
Michi.
-
Aug 23, 2012 11:33 AM in response to alexnolasby gadgetmax,★HelpfulBoth session storage and local storage have not worked for me. Have you tried cookies? They are working for me and persist between pages and sessions.
-
Aug 23, 2012 1:55 PM in response to MichiHenningby alexnolas,Unfortunately, localStorage is not available.
http://www.baldurbjarnason.com/notes/an-epub-experiment/
epub running modernizr
-
Aug 23, 2012 2:00 PM in response to alexnolasby MichiHenning,I have had no problems using local storage for the widget in my IBA book. Local storage is used to restore the state of the widget to its previous state. This work across opening and closing the book, and even across ibooks restarts. You can download the widget here:
http://www.drumanddance.com.au/DjembeRopeCalc/DjembeRopeCalc.zip
If you open the zip archive, you can look at the Javascript to see exactly how it works.
Michi.
-
Aug 23, 2012 8:18 PM in response to gadgetmaxby alexnolas,Cookies! Of course, now this actually worked across pages except for the limitation in size, but I think I can manage.
A simple wrapper around cookies like this one
http://code.google.com/p/cookie-js/source/browse/trunk/cookie.js
would do the work, be sure to replace escape and unescape with more up to date functions though.
-
Aug 23, 2012 8:20 PM in response to MichiHenningby alexnolas,sessionStorage may work with the ibook format, but it doesn't for epub3
-
Aug 24, 2012 2:51 AM in response to alexnolasby MichiHenning,alexnolas wrote:
sessionStorage may work with the ibook format, but it doesn't for epub3
Thanks for letting us know. I have no experience with ePub, only with IBA. It's weird though that the same execution environment yields different resutls. The only reason I can think of is some difference in the HTML. Have you tried dropping my widget into your ePub as a test? I have no idea whether that will work, but it might be worth a try. That widget definitely works in iBooks on the iPad.
Michi.