News for hackers. Stuff that matters.
Re:Htmx 1.9.0 has been released by leke on Wednesday April 12, 2023 @12:27AM (#35535010)
I'm currently using htmx on my latest project to only change parts of the page that need changing. This is fine, but I am finding some weirdness happening in that design though. For example, if I load a portion with some JS in it, the consecutive times I load it, gives me "already declared variable" errors. I guess this is because the JS stuff is hoisted outside of the area it's called, so when it's recalled, it hasn't been removed with the previous request. My solution has been to use `var` but I guess this is not the best solution and something more fundamentally wrong.
Re:Htmx 1.9.0 has been released by thornewolf on Wednesday April 12, 2023 @01:28AM (#35535376)
Read up on HATEOAS - Hypermedia as the engine of application state. Long story short, don't use J's to store state, use html responses.
Re:Htmx 1.9.0 has been released by arcanemachiner on Wednesday April 12, 2023 @04:19AM (#35536495)
I use `window.someVar = "blah"` instead of `var someVar = "blah"`. It's a dirty hack, but it works around the re-binding issue.