(no title)
Dauros
|
2 years ago
Because they are actually two distinct views: one is a details view, the other one is a form view. HTMX loads the form view and replaces the respective part of the page. But it needs to contact the backend for the form, you don't have the data model on the client like with an SPA framework, so you cannot generate the form.
schemescape|2 years ago
Dauros|2 years ago
With some constraints you can create a page that works with or without JS. The same endpoint can be used for serving HTML fragments for HTMX and full page for JS-disabled clients since the HTMX request can be detected by the HX-Request header.
schemescape|2 years ago
https://enmascript.com/articles/2019/09/26/toggle-content-on...
I don’t like messing with the URL to achieve this, so unless using the “details” element, maybe JavaScript is actually the best approach…
robertoandred|2 years ago
neurostimulant|2 years ago
john2x|2 years ago
Dauros|2 years ago