htmx icon indicating copy to clipboard operation
htmx copied to clipboard

`hx-boost` doesn't load script files

Open StandingPadAnimations opened this issue 1 year ago • 1 comments

When using hx-boost, pages that bring in additional scripts and resources don't get scripts loaded. To be specific, pages that add additional scripts to <head> don't get additional scripts added to <head>

Although I could simply add every script to head globally, I'd rather not as that takes extra time to load

StandingPadAnimations avatar Apr 15 '24 18:04 StandingPadAnimations

This is literally what hx-boost is for. hx-boost makes your anchor links into AJAX requests, which specifically DO NOT reload the scripts in <head>. Just make a normal anchor link, or send down an HX-Refresh response header to force those scripts to reload from boosted links. https://htmx.org/docs/#boosting https://v1.htmx.org/reference/#response_headers

defenestrator avatar Apr 22 '24 21:04 defenestrator