15 ms·
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 th
by leke 4y ago
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.
- thornewolf 4y agoRead up on HATEOAS - Hypermedia as the engine of application state. Long story short, don't use J's to store state, use html responses.
- arcanemachiner 4y agoI use `window.someVar = "blah"` instead of `var someVar = "blah"`. It's a dirty hack, but it works around the re-binding issue.