Reputation: 1
I'm trying to make a simple file viewing with WebODF in javascript. My code looks like this:
<head>
<script src="webodf.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
function init() {
var odfelement = document.getElementById("odf"),
odfcanvas = new odf.OdfCanvas(odfelement);
odfcanvas.load("c:\file directory\myfile.odt");
}
window.setTimeout(init, 0);
</script>
</head>
When I'm running the code I'm getting an alert:
ASSERTION FAILED: odf.OdfCanvas constructor needs DOM element
Why is that happening and how can I open the odt
file?
Upvotes: 0
Views: 744