05-31-2012, 12:47 PM | #1 |
Junior Member
Posts: 6
Karma: 10
Join Date: May 2012
Device: iPad
|
Javascript in ePub
I made a crossword puzzle using software that automatically exports as an html page with css and javascript externally linked. What's the best way to put this into my epub. Will this work in epub? I know that js is supported in epub 3, yes I know many readers don't have epub3 capabilities yet. I'm just asking
1) Will a js crossword puzzle work in my epub 2) Already having the .epub file what's the best way to go about inserting my html page with my crossword puzzle, and the css / js pages that accompany it. Thanks -Techno |
05-31-2012, 02:50 PM | #2 |
Linux User
Posts: 2,279
Karma: 6123806
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: none
|
There's no JS in EPUB. Or any other way for interactive content for that matter. So no, it won't work. Not unless you create a static page for every possible state and give the reader instructions such as (if you want to put A in field x,y continue on page 9155)
|
Advert | |
|
06-01-2012, 09:07 AM | #3 |
Junior Member
Posts: 6
Karma: 10
Join Date: May 2012
Device: iPad
|
Sorry I suppose I meant "enhanced" epub3. If you're saying there is no javascript in epub whatsoever, then it appears either
1)I need a more knowledgeable poster or 2)The interactive epubs I've been looking at that are noted as using javascript, are all lies. Thanks |
06-02-2012, 01:02 AM | #4 |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
yes, ePub 3 will support Javascript but you already knew that. In the context of why would you ask a question you already know the answer to, no the current ePub (version 2) does not support javascript.
|
06-05-2012, 10:39 AM | #5 |
Junior Member
Posts: 6
Karma: 10
Join Date: May 2012
Device: iPad
|
DaleDe,
Do you know the answer to this question: Already having the .epub file what's the best way to go about inserting my html page with my crossword puzzle, and the css / js pages that accompany it? I was looking for a forum to best post this question in, because I'm having trouble trying to integrate the javascript. I'm currently using sigil and inserting the javascript into the Misc folder, and then relinking the html page. However, this isn't providing the best results. I suppose what I'm really asking is, is there an alternative to sigil for editing the actual HTML pages that is epub specific (i.e not textwrangler / textedit or other basic html editers). With 8,131 posts and I'm sure counting I would've thought that your answer could've been more helpful, however it wasn't. I didn't ask if epub 3 will support javascript (you can reference my first post), I'm asking if it will support a javascript crossword puzzle. A question that only someone who has hopefully tried this before would've been able to answer. So please, why artificially bump that post count up and not answer my question at the same time ? |
Advert | |
|
06-06-2012, 12:39 PM | #6 |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
I was clarifying and correcting frostschutz post, it was not aimed at your post. It looked like you might be asking about trying something in 2.0 since you were asking about Sigil. Sigil does not support 3.0. Our wiki talks about ePub 3 and currently is weak on Javascript but have plenty of offsite links that may help. Once you figure it out please update our wiki.
I have believe that crossword puzzle should work since javascript is supported although it may be difficult to find a good reader. I am not just posting to bump up the thread. This is a discussion group, not Ask and answer.com Dale |
06-06-2012, 04:38 PM | #7 |
Grand Sorcerer
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
Implementing a crossword puzzle as an ebook would be difficult even under ideal circumstances. Have you considered creating an app instead? There are couple of free programs available that let you design apps with HTML and JavaScript only.
You can read about it for example in Building iPhone Apps with HTML, CSS, and JavaScript, which you can you access for free at the O'Reilly web site. (There are also similar tools for Android based phones and tablets.) |
06-07-2012, 10:59 PM | #8 |
Enthusiast
Posts: 37
Karma: 493532
Join Date: May 2010
Device: ipad
|
I don't know how hard it would be to get your specific crossword code to work, but here's a few comments about javascript with Sigil:
You can place javascript directly in the <head> section if you escape it via CDATA something like so: <script type="text/javascript"> //<![CDATA[ function setup() { //... { window.onload=setup; //]]> </script> If you prefer to work with an external file, I'll just mention that if you place it in the Styles folder - with a .css extension instead of .js - you can then edit it with Sigil and the javascript code still works. AFAIK, iBooks is the only reader that pays attention to the javascript, with the possible exception of the Kobo iOS reader. -Bill |
06-08-2012, 08:28 AM | #9 | |
Junior Member
Posts: 6
Karma: 10
Join Date: May 2012
Device: iPad
|
Quote:
Bill, I had the code to load the script however I didn't have the CDATA information. I added it and my crossword is working as intended. TYVM! -Techno4 |
|
11-05-2012, 12:50 PM | #10 | |
Junior Member
Posts: 2
Karma: 10
Join Date: Nov 2012
Device: none
|
Let no one tell you otherwise unless they have tried and failed. Your puzzle should work fine without an issues, i have developed epubs with advanced interactions. U can hook me up with your puzzle and i will give you a demo how to implement it into your epub book.
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Javascript in ePub. | Vijay | ePub | 22 | 12-28-2023 09:43 AM |
Is there any android epub reader supporting epub3 with audio/video/javascript? | happycoding | Android Developer's Corner | 10 | 07-29-2014 11:16 AM |
question regarding javascript and html in epub output | whol019 | ePub | 3 | 05-16-2012 01:51 PM |
epub et javascript | zelda_pinwheel | Software | 9 | 12-09-2010 04:56 PM |
I need Javascript help | Nate the great | Workshop | 4 | 04-04-2009 12:55 AM |