You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For those who use behaviors, how do you handle a situation where you have a page loaded with Hyperscript, and a part of the page is refreshed using HTMX? What I mean is that the content returned via AJAX includes a behavior script tag referencing an external "._hs" file that needs to be installed on an element also returned in the response. In my case, I’m obviously getting an error like "No such behavior defined as xxx" because Hyperscript wasn’t aware of it when the page initially loaded. Is there a function I could call on the Hyperscript object to load these new behaviors? I was thinking of processNode ?
Edit: As I cannot succeed to dynamically load behaviors as they arrive in responses, I resigned myself to load all the behaviors in the head of the page. I hope someone will bring me light soon :)
Thank you in advance.
The text was updated successfully, but these errors were encountered:
May I ask if this project is still being actively maintained? I really appreciate the work that's gone into it and hope the community is still involved.
Hi Senna, I think the best solution is the one you came up with: to load all the hyperscript behaviors early. That avoids any ordering issues. content that is handled by htmx and that contains hyperscript should be automatically processed because hyperscript listens for new content from htmx here:
Hello everyone,
For those who use behaviors, how do you handle a situation where you have a page loaded with Hyperscript, and a part of the page is refreshed using HTMX? What I mean is that the content returned via AJAX includes a behavior script tag referencing an external "._hs" file that needs to be installed on an element also returned in the response. In my case, I’m obviously getting an error like "No such behavior defined as xxx" because Hyperscript wasn’t aware of it when the page initially loaded. Is there a function I could call on the Hyperscript object to load these new behaviors? I was thinking of processNode ?
Edit: As I cannot succeed to dynamically load behaviors as they arrive in responses, I resigned myself to load all the behaviors in the head of the page. I hope someone will bring me light soon :)
Thank you in advance.
The text was updated successfully, but these errors were encountered: