Created
October 1, 2022 20:24
-
-
Save lee2sman/21f9dc3cc216f9c0bf4fafcfa34dcaa8 to your computer and use it in GitHub Desktop.
trivial fengari example demonstrating manipulating the DOM with Lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Fengari test</title> | |
<script src="fengari-web.js"></script> | |
</head> | |
<body> | |
<script src="main.lua" type="application/lua" async></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--requires fengari library https://fengari.io/ | |
js = require "js" | |
local window = js.global | |
local document = window.document | |
local body = document.body | |
body.innerHTML = "<h1>cal</h1><h2>1</h2><h3>hello world</h3><p>hello</p>" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment