I’m struggling trying to get a epub file to display in a web page using epub.js. I’ve seen all the examples, and documentation but I can’t get an epub to appear. I have this HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test</title>
<style>
#area {
box-sizing: border-box;
position: absolute;
left: 50px;
top: 10px;
width: 600px;
height: 400px;
border: 1px dotted red;
}
</style>
<script src="epub.js"></script>
<script src="jszip.min.js"></script>
<script>
window.onload = function () {
let book = ePub('epub/house.epub'),
rendition = book.renderTo('area',
{
openAs: 'epub',
method: 'default',
width: '100%',
height: 400
}
),
displayed = rendition.display();
};
</script>
</head>
<body>
<div id="area"></div>
</body>
</html>
and running it in a browser from VS Code I get this in the network panel:
So while everything appears to load, and no errors display in the console, I keep getting an empty #area.
What am I missing? Or is there a basic example I can download that does work that I can check?