U am trying to get the micropython.js to run in a webpage, I have followed the instructions to build the .js file and that works in node with no issues.
Using the html code from the git repo I am only getting a blank page, nothing inside of it ?
Code: Select all
<!doctype html>
<html>
<head>
<script src="/home/sysadmin/micropython/ports/javascript/build/micropython.js"></script>
</head>
<body>
<div id='mp_js_stdout'></div>
<script>
mp_js_stdout.addEventListener('print', function(e) {
document.write(e.data);
}, false);
mp_js_init(64 * 1024);
mp_js_do_str('print(\'hello world\')');
</script>
</body>
</html>
Regards Mike