Re:Htmx Is the Future
by pdonis on Friday May 05, 2023 @01:38PM
(#35832576)
The article under discussion here appears to be saying that HTMX can work without Javascript enabled. But HTMX itself is a Javascript library, correct? So how can it work without Javascript enabled?
[ Parent
| on HN ]
Re:Htmx Is the Future
by recursivedoubts on Friday May 05, 2023 @02:08PM
(#35833021)
the article says it is possible to build web applications that use htmx for a smoother experience if javascript is enabled, but that properly falls back to vanilla HTML if js is not enabled
this is called progressive enhancement[1], and yes, htmx can be used in this manner although it requires some effort by the developer
unpoly, another hypermedia-oriented front end library, is more seamless in this regard and worth looking at
[1] - https://developer.mozilla.org/en-US/docs/Glossary/Progressiv...
Re:Htmx Is the Future
by elliottinvent on Friday May 05, 2023 @02:08PM
(#35833023)
I think the point is that by using HTMX your site can degrade gracefully for non-JS users.
A site for a project of mine [1] is built with HTMX and operates more or less the same for JS and no-JS users.
I’m aiming to add some bells and whistles for JS users but the version you see there is more or less the experience non-JS users gets too:
Re:Htmx Is the Future
by the_gastropod on Friday May 05, 2023 @02:17PM
(#35833147)
H̶T̶M̶X̶ e̶m̶b̶r̶a̶c̶e̶s̶ t̶h̶e̶ i̶d̶e̶a̶ o̶f̶ p̶r̶o̶g̶r̶e̶s̶s̶i̶v̶e̶ e̶n̶h̶a̶n̶c̶e̶m̶e̶n̶t̶ [̶1̶]. Y̶o̶u̶ s̶t̶a̶r̶t̶ w̶i̶t̶h̶ a̶ f̶u̶n̶c̶t̶i̶o̶n̶a̶l̶, j̶a̶v̶a̶s̶c̶r̶i̶p̶t̶-̶f̶r̶e̶e̶, w̶e̶b̶ a̶p̶p̶l̶i̶c̶a̶t̶i̶o̶n̶. H̶T̶M̶X̶ l̶a̶y̶e̶r̶s̶ o̶n̶ t̶o̶p̶ o̶f̶ t̶h̶i̶s̶ t̶o̶ ̶m̶a̶k̶e̶ t̶h̶e̶ e̶x̶p̶e̶r̶i̶e̶n̶c̶e̶ b̶e̶t̶t̶e̶r̶, b̶u̶t̶ i̶t̶'s̶ e̶f̶f̶e̶c̶t̶i̶v̶e̶l̶y̶ o̶p̶t̶i̶o̶n̶a̶l̶.
[1] https://developer.mozilla.org/en-US/docs/Glossary/Progressiv...
Whoa... I was very slow apparently
Re:Htmx Is the Future
by mixmastamyk on Friday May 05, 2023 @05:16PM
(#35835251)
Adding the form element allows it to post to the server without javascript, just like olden times. Since the htmx header is not included, the backend was instructed to return a full page instead of a fragment.