Skip to content

function "not defined" - what am I doing wrong? #4502

Answered by SimoTod
fpolli asked this question in 1. Help
Discussion options

You must be logged in to vote

If you are inserting the script tag dynamically, you will not be able to call it in that way as a global function.

It's not the way you should do it, your state and functions should be defined in your component, either in x-data or in Alpine.data.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@fpolli
Comment options

@SimoTod
Comment options

SimoTod Jan 14, 2025
Collaborator

Answer selected by fpolli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants