aboutsummaryrefslogtreecommitdiff
path: root/samegame.c
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2022-12-11 11:53:17 +0000
committerBen Harris <bjh21@bjh21.me.uk>2023-01-19 20:34:48 +0000
commit48ded126a9fd399cf2d9c66ee928f4d1d6d065e4 (patch)
tree6ca540cb875c71123a76abd1957ece0321785d79 /samegame.c
parent9d7b044c01680e408094d3bae82f622ae8a5b48b (diff)
downloadpuzzles-48ded126a9fd399cf2d9c66ee928f4d1d6d065e4.zip
puzzles-48ded126a9fd399cf2d9c66ee928f4d1d6d065e4.tar.gz
puzzles-48ded126a9fd399cf2d9c66ee928f4d1d6d065e4.tar.bz2
puzzles-48ded126a9fd399cf2d9c66ee928f4d1d6d065e4.tar.xz
js: Look up elements in the DOM as early as possible
Now that our script is loaded using <script defer>, we can rely on the DOM's being complete as soon as it starts running. So when we declare a variable to point to a DOM element, we can initialise it with that element. This saves having these odd initialisations scattered around the code, usually but not always at the site of first use. I'd like to be able to do the same thing with the variables that point to C functions, but the Module.cwrap() call isn't entirely safe before Emscripten has finished loading the C code.
Diffstat (limited to 'samegame.c')
0 files changed, 0 insertions, 0 deletions