View Single Post
Old 10-22-2021, 11:25 AM   #4
vissidarte
Junior Member
vissidarte began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2021
Device: none
--You cannot load jquery from a web url. Either dont use it or bundle it in the actual epub file.--

OK missed that part, I've put a local copy of jquery in the archive. The relevant portions of the EPUB archive now look like this, but I still get the same result: the javascript executes in the calibre Editor but not in the calibre Reader.

From start.xhtml
<head>
<title>Demo</title>
<script src="META-INF/jquery-3.5.1.min.js">
</script>
...
</head>

From metadata.opf:
<manifest>
<item href="start.xhtml" id="start" media-type="application/xhtml+xml" properties="scripted"/>
<item href="META-INF/jquery-3.5.1.min.js"
media-type="text/javascript"
properties="scripted"/>
<item href="toc.ncx" id="ncx" media-type="application/x-dtbncx+xml"/>
</manifest>

Is there something wrong with the above code? Does the js library have to also be added to the spine? Is the path name correct? (The META-INF path was the path name that showed up in the prompt when I entered the source attribute)?
I am running calibre on Big Sur. Is it possible that the reader is using features that are triggering Big Sur's security infrastructure whereas the editor is not?
vissidarte is offline   Reply With Quote