@load doesn't seem to work #4421
Answered
by
SimoTod
florian-sun
asked this question in
1. Help
-
This is an example. I got no alert when I load the page.
|
Beta Was this translation helpful? Give feedback.
Answered by
SimoTod
Oct 29, 2024
Replies: 2 comments 3 replies
-
The load event is dispatched on the window object, not on the single html tags: https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event You can use the window modifier, see https://alpinejs.dev/directives/on#window |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
florian-sun
-
OK, thanks |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The load event is dispatched on the window object, not on the single html tags: https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event
You can use the window modifier, see https://alpinejs.dev/directives/on#window