3 ms·
There’s also a Javascript implementation of Lua which allows one to run Lua in a browser: https://github.com/fengari-lua/fengari-web https://github.com/fengari
by strenholme 1y ago
There’s also a Javascript implementation of Lua which allows one to run Lua in a browser:
https://github.com/fengari-lua/fengari-web https://github.com/fengari-lua/fengari-web
I don’t know if this can access the DOM in Lua, but considering that Fengari is in Javascript, adding a _DOM global variable should not be too hard (if it hasn’t already been done).
- bawolff 1y agoFengari lets you access the DOM. Its pretty cool.
- shakna 1y agoNo need for _DOM. local js = require "js" local window = js.global local document = window.document window:addEventListener("load", function() local el = document:getElementById("main") el:addEventListener("click", function(evt) js.console:log(evt.target) end document.body:appendChild(el) end