Window load event listener not running from rust. #4375
-
Hi all, I've been trying to run a closure on window load, but it's just not running for me, and I'm not sure why. Here's the code which attaches the listener
(full code here: https://github.com/vjackson725/wasm_tests/tree/main/onload) I also attached an event listener directly using javascript, and that worked, so I'm not sure what's going wrong here. Am I doing something wrong, or is something else going on? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
That's because the |
Beta Was this translation helpful? Give feedback.
That's because the
Window
has already loaded at the point where Wasm is executed.You can check interactively if the
Window
is loaded viaDocument.readyState
.