Extracting script tags from the serverResponse, and wait a tick before swapping? #2374
kg-currenxie
started this conversation in
General
Replies: 1 comment 1 reply
-
|
I also just became interested in this very thing! I haven't got my server returning script tags yet but had a very similar plan in mind. Did you have any success with this? I'm going to give this a go today. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi :)
We have a case using HTMX and AlpineJS together. We want to add
Alpine.data()per-page in script tags, rather than putting everything in the js-bundle.the server response can look like this:
However, alpine doesn't like this, because
x-datahas already started evaluating, before the script tag is evaluated.We got a suggestion from someone on the Alpine side to do something like this:
I've tried something like this:
would this even be possible? or any other ways?
Beta Was this translation helpful? Give feedback.
All reactions