![]() |
#1 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,619
Karma: 23190435
Join Date: Dec 2010
Device: Kindle PW2
|
![]()
I'm experimenting with creating bilingual epubs. I'd like to format sentences as non-underlined links that will display translations when the user clicks on them. I created an xhtml file that uses onclick to manipulate the innerHTML of an anchor element. It works fine as an xhtml file, but not when I add the file to an epub.
Is this yet another xhtml element not supported by the epub standard? BTW, is there a list of valid xhtml elements that are currently not supported by the ePUB standard? |
![]() |
![]() |
![]() |
#2 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,518
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
ePUB renderers often have no support for any scripting capabilities, and the specification certainly does not mandate any script language, and actually disencourages them. Also, the subset of XHTML supported by ePUB (http://www.idpf.org/doc_library/epub...htm#Section2.2) does not include the "Intrinsic Events" module, which contains "onclick" et al.
So yes, dynamic content is largely not supported by the ePUB spec (nor by ePUB readers). In the specification linked above you have a list of what is (or should be) supported, both in XHTML and CSS. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 37
Karma: 493532
Join Date: May 2010
Device: ipad
|
If your target is iBooks, then your example does indeed work there, as you probably know. Javascript is also used in some of the newer educational titles in iTunes U.
|
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,619
Karma: 23190435
Join Date: Dec 2010
Device: Kindle PW2
|
Thanks for your quick and detailed answer. I'll check out the link.
|
![]() |
![]() |
![]() |
Tags |
dynamic html, epub, innerhtml, onclick |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
DR800 & tyh promised text highligting | pavelh | iRex | 6 | 06-18-2010 01:08 PM |
Search & replace TEXT | ToeRag | Calibre | 3 | 04-10-2010 01:44 PM |
Text Analysis & Paragraph Detection | ahi | Workshop | 15 | 09-14-2009 11:28 PM |
Cybook & text-based pdfs | StephieP | Bookeen | 17 | 04-28-2008 11:50 AM |