Replies: 3 comments 2 replies
-
Indeed, manually firing Assuming you're talking about your own event listeners here, and not the ones that htmx sets up internally, you could use mutation observers to listen for added nodes to the DOM, and bind listeners to them |
Beta Was this translation helpful? Give feedback.
-
In my working project, almost event listener all are added by jQuery.on using jQuery.ready (except new js written by me) like $($("#btn").on(....)) https://api.jquery.com/on/ so I need someway to trigger all event listener add by jQuery and obviously I find an weird but at least working way. Maybe better to let just trigger all jQuery ready event listener? |
Beta Was this translation helpful? Give feedback.
-
Just found that jQuery store all event listener in itself. seems possible to write a plugin to fire all jQuery event listener |
Beta Was this translation helpful? Give feedback.
-
Currently I working on an internal old jsp project with a bunch of jquery script.
After swapping out whold body tag, I found only possible way to add all event listener back (without rewriting a bunch of jquery js) is to fire DomContentLoaded by htmx.
and I think a little bit weird to fire native event by myself.
Beta Was this translation helpful? Give feedback.
All reactions