<html>
<head>
<script type="module" src="topo_space.js"></script>
</head>
<body onload="main()">
</body>
</html>
topo_space.js:
export function main(){
const innerHTML = `<svg id="main_svg" width="959" height="704"></svg>`;
console.log(innerHTML);
document.body.innerHtml = innerHTML;
}
Getting error:
topo_space.html:6 Uncaught ReferenceError: main is not defined at onload
I want to stick to using module, because the js can itself further import a json as module, which I find extremely cool.