Preferences

There’s also a Javascript implementation of Lua which allows one to run Lua in a browser:

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).


Fengari lets you access the DOM. Its pretty cool.
No 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

This item has no comments currently.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal