Answers.Body: <p>JavaScript is an optional part of the <a href="http://www.idpf.org/epub/301/spec/epub-contentdocs.html#sec-scripted-content-rs-reqs" rel="nofollow">epub 3.0 specification</a>:</p>
  
  <blockquote>
    <p>EPUB Content Documents may contain scripting using the facilities
    defined for this in the respective underlying specifications ([HTML5]
    and [SVG]).</p>
  </blockquote>
  
  <p>What this means is that even a fully-compliant epub 3.0 device doesn't need to implement JavaScript support. The ones that do will generally be the "more bells and whistles" devices; the iPad, for example, supports JavaScript. The IDPF's epub Chrome extension <a href="https://chrome.google.com/webstore/detail/readium/fepbnnnkkadjhjahcafoaglimekefifl?hl=en-US" rel="nofollow">Readium</a> does as well.</p>
  
  <p>Note that according to the <a href="http://www.idpf.org/epub/301/spec/epub-contentdocs.html#sec-scripted-content-rs-reqs" rel="nofollow">epub 3.0 specification</a>, the following criteria for reading systems that support JavaScript must be met:</p>
  
  <blockquote>
    <p>› It must support container-constrained scripting and may support
    spine-level scripting.</p>
    
    <p>› It may render Scripted Content Documents as an interactive, scripted
    User Agent according to [HTML5].</p>
    
    <p>› It must not allow a container-constrained script to modify the DOM
    of the parent Content Document or other contents in the EPUB
    Publication, and must not allow it to manipulate the size of its
    containing rectangle. (Note: Even if a script is not
    container-constrained, the Reading System may impose restrictions on
    modifications (see also the dom-manipulation feature).)</p>
    
    <p>› It may place additional limitations on the capabilities provided to
    scripts during execution (e.g., limiting networking).</p>
    
    <p>› It must implement the JavaScript navigator extension object
    epubReadingSystem defined in Appendix A, JavaScript epubReadingSystem
    Object . It also must support the dom-manipulation and layout-change
    features defined in Features in container-constrained scripting
    contexts.</p>
    
    <p>› It must regard the scripted [Publications301] property of the
    Package Document manifest item element as the authoritative definition
    of whether an EPUB Content Document includes scripting.</p>
  </blockquote>
  
  <p>EDIT: Popup text and images are definitely possible using JavaScript in iBooks. For an example, check out <a href="https://beneaththeink.com/" rel="nofollow">Beneath The Ink</a>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-25T04:34:15.053Z
Answers.LastActivityDate: 2015-05-26T14:51:46.463Z
Answers.LastEditDate: 2015-05-26T14:51:46.463Z
Answers.UserDisplayName: Tom
Answers.Body: <p>Also Adobe Digital Editions 4.0 seems to reading JavaScript. It is rather important, because ADE is rendering engine for most e-readers for the market. Unfortunately not all (if any at all) manufacturers use new engine at this time.
  ADE 4.0 is available on <a href="http://www.adobe.com/solutions/ebook/digital-editions/download.html" rel="nofollow">Adobe</a> sites </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-25T12:46:33.720Z
Answers.Text: Which devices use ADE? Sony Reader use it or no?
Answers.UserDisplayName: Chester Mc Allister
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-25T14:01:31.577Z
Answers.Text: I wasn't able to find any confirmation but you can safely assume that Sony use Adobe RMSDK. But Sony have abandon developing of any e-reading systems back in 2014 so you can't count Sony devices will be able to run any of JavaScript.
Answers.UserDisplayName: Glorifind
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-16T03:14:44.363Z
Answers.Text: I'd not expect Sony devices to ever do JavaScript
Answers.UserDisplayName: Auspex
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-25T07:04:22.753Z
Answers.LastActivityDate: 2015-05-25T07:04:22.753Z
Answers.UserDisplayName: Glorifind
Body: <p>I'm looking for an e-reader that can embed Javascript in an e-book. I need to display a popup in the e-book but using a e-reader.</p>
  
  <p>Apparently, it is <a href="https://stackoverflow.com/questions/19167688/embed-javascript-in-a-kindle-ebook">not possible for the Kindle Reader</a> but I'm wondering if it is possible with another device?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-05-26T13:14:56.627Z
Comments.Text: I need to load some information as a popup with some part of the text. The better solution will be Javascript but for now I've didn't find any device that embed JS.
Comments.UserDisplayName: Chester Mc Allister
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-05-26T14:01:44.227Z
Comments.Text: I need to have javascript embedded in the ebook naturally and these javascript should be `used` in the e-reader device. My problem is to find a e-reader device that allow the use of Javascript.
Comments.UserDisplayName: Chester Mc Allister
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-05-26T14:19:08.637Z
Comments.Text: I've updated the answer. I know that ePub3 allows JS development but for me I want to use these possibilities in an e-book loaded in an e-reader.
Comments.UserDisplayName: Chester Mc Allister
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-05-26T15:03:26.183Z
Comments.Text: Welcome to Ebooks.SE by the way.
Comments.UserDisplayName: Anthon
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-05-26T15:06:22.443Z
Comments.Text: @Anthon thanks, my answer was unclear because for me it was clear that I need to use JS in ebook in the e-reader and not in any other app. Now it's clear ;-)
Comments.UserDisplayName: Chester Mc Allister
Tags: <ebook-readers><embedding>
Title: Embed JavaScript in an e-book using an e-reader
UserDisplayName: Chester Mc Allister
ThreadText: # Embed JavaScript in an e-book using an e-reader
  
  (Asked by: username_0 on 2015-05-24)
  
  I'm looking for an e-reader that can embed Javascript in an e-book. I need to display a popup in the e-book but using a e-reader.
  
  Apparently, it is [not possible for the Kindle Reader](https://stackoverflow.com/questions/19167688/embed-javascript-in-a-kindle-ebook) but I'm wondering if it is possible with another device?
  
  **Tags:** ebook-readers, embedding
  
  > **Comments:**
  > **username_0**: I need to load some information as a popup with some part of the text. The better solution will be Javascript but for now I've didn't find any device that embed JS.  
  > **username_0**: I need to have javascript embedded in the ebook naturally and these javascript should be `used` in the e-reader device. My problem is to find a e-reader device that allow the use of Javascript.  
  > **username_0**: I've updated the answer. I know that ePub3 allows JS development but for me I want to use these possibilities in an e-book loaded in an e-reader.  
  > **username_1**: Welcome to Ebooks.SE by the way.  
  > **username_0**: @username_1 thanks, my answer was unclear because for me it was clear that I need to use JS in ebook in the e-reader and not in any other app. Now it's clear ;-)  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2015-05-25. Score: 2
  
  JavaScript is an optional part of the [epub 3.0 specification](http://www.idpf.org/epub/301/spec/epub-contentdocs.html#sec-scripted-content-rs-reqs):
  
  > EPUB Content Documents may contain scripting using the facilities
  > defined for this in the respective underlying specifications ([HTML5]
  > and [SVG]).
  
  What this means is that even a fully-compliant epub 3.0 device doesn't need to implement JavaScript support. The ones that do will generally be the "more bells and whistles" devices; the iPad, for example, supports JavaScript. The IDPF's epub Chrome extension [Readium](https://chrome.google.com/webstore/detail/readium/fepbnnnkkadjhjahcafoaglimekefifl?hl=en-US) does as well.
  
  Note that according to the [epub 3.0 specification](http://www.idpf.org/epub/301/spec/epub-contentdocs.html#sec-scripted-content-rs-reqs), the following criteria for reading systems that support JavaScript must be met:
  
  > › It must support container-constrained scripting and may support
  > spine-level scripting.
  >
  > › It may render Scripted Content Documents as an interactive, scripted
  > User Agent according to [HTML5].
  >
  > › It must not allow a container-constrained script to modify the DOM
  > of the parent Content Document or other contents in the EPUB
  > Publication, and must not allow it to manipulate the size of its
  > containing rectangle. (Note: Even if a script is not
  > container-constrained, the Reading System may impose restrictions on
  > modifications (see also the dom-manipulation feature).)
  >
  > › It may place additional limitations on the capabilities provided to
  > scripts during execution (e.g., limiting networking).
  >
  > › It must implement the JavaScript navigator extension object
  > epubReadingSystem defined in Appendix A, JavaScript epubReadingSystem
  > Object . It also must support the dom-manipulation and layout-change
  > features defined in Features in container-constrained scripting
  > contexts.
  >
  > › It must regard the scripted [Publications301] property of the
  > Package Document manifest item element as the authoritative definition
  > of whether an EPUB Content Document includes scripting.
  
  EDIT: Popup text and images are definitely possible using JavaScript in iBooks. For an example, check out [Beneath The Ink](https://beneaththeink.com/).
  
  
  ---
  
  ### Answer by username_3 on 2015-05-25. Score: 0
  
  Also Adobe Digital Editions 4.0 seems to reading JavaScript. It is rather important, because ADE is rendering engine for most e-readers for the market. Unfortunately not all (if any at all) manufacturers use new engine at this time.
  ADE 4.0 is available on [Adobe](http://www.adobe.com/solutions/ebook/digital-editions/download.html) sites
  
  > **Comments:**
  > **username_0**: Which devices use ADE? Sony Reader use it or no?  
  > **username_3**: I wasn't able to find any confirmation but you can safely assume that Sony use Adobe RMSDK. But Sony have abandon developing of any e-reading systems back in 2014 so you can't count Sony devices will be able to run any of JavaScript.  
  > **username_4**: I'd not expect Sony devices to ever do JavaScript  
  
  ---
  
  