How to run HTML/Alpine functions from Javascript Module? Outside the window object. #504
blenderman-de
started this conversation in
4. General
Replies: 2 comments 5 replies
-
Clarification and more tests: This is my script tag On my application: I can run the window.modal() functions from my index.js file but get into errors or get only initial states or nothing is happening. From HTML/Alpine side everything is working fine.
The second jsfiddle: https://jsfiddle.net/blenderman/v1x9pqr4/ The functions work at the beginning. But not in a later event. Then nothing more happens. At least I tried Parcel global variable with no result 😿
|
Beta Was this translation helpful? Give feedback.
1 reply
-
2 ways to do this:
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Community,
I'm using your great framework together with other ES6 libs and with the Parcel bundler. Like in the documentation example I defined my function on the window object.
It works directly from HTML/Alpine. I can access all the functions and values from my index.js. This part works great! 🥳
But how can I run a function like
window.dropdown().close();
oropen('contact')
from Javascript to HTML/Alpine❓Created an example on jsfiddle. Thanks a lot for your help.
Beta Was this translation helpful? Give feedback.
All reactions