Closed multipliedtwice closed 3 weeks ago
You can already do this with <svelte:head><script>...</script></svelte:head>
in the component and continuing to specify csr = false
. Alternatively, if you want your script to run later, you can also put it anywhere in the component, as long as it's not a top-level element, which has special meaning to Svelte.
<div class="hidden">--custom.js--</div>
at any part of the page.
And then in hooks
responseBody = (await response.text())
.replace("--custom.js--", '<script src="/custom.js"></script>')
do the trick
Describe the problem
I have a simple statically generated landing page, that doesn't have much logic on it - just a basic dropdown menu.
Scheduler/entry/etc is an overkill for a simple landing page that needs to switch a couple of CSS classes
Describe the proposed solution
where the end user could do some custom arbitrary JS that will be added as a script at the bottom of the page
Alternatives considered
No response
Importance
nice to have
Additional Information
No response