3 ms·
That makes no sense, HTML is by design not supposed to be dynamic, that's the point of JS. There's a nice, clean, separation of concerns with HTML, CSS, and JS
by candiddevmike 3y ago
That makes no sense, HTML is by design not supposed to be dynamic, that's the point of JS. There's a nice, clean, separation of concerns with HTML, CSS, and JS.
As an aside, htmx uses JS under the covers to make HTML dynamic.
- pphysch 3y ago> HTML is by design not supposed to be dynamic, that's the point of JS. You are putting far too much faith in the design of web standards. Anyways, here's a counterexample to your claim: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog https://developer.mozilla.org/en-US/docs/Web/HTML/Element/di...
- ipaddr 3y agoA dialogue doesn't need javascript. You can render in html and can use server side logic to decide to display it
- sodapopcan 3y ago<audio> and <video> are older examples. And of course <button type="submit">, <button type="reset">, annnnnd cough <a>. There was <blink> and for some reason still <marquee> if you wanna consider animations dynamic.
- pphysch 3y agoThanks, yeah, there are lots of examples of standard HTML features that wouldn't make any sense in a true static document DSL like LaTeX, or a paper document. HTML is interactive and dynamic.
- sodapopcan 3y agoI was just augmenting your answer as I liked it! It was also sort of a response to my sibling responder as they didn't seem to get what you were saying. EDIT: Oh wait, maybe they did now that I re-read it... maybe? I think it's time for bed.
- recursivedoubts 3y agoHTML is designed to be dynamic via hypermedia controls, that is, elements embedded in documents that communicate some sort of hypermedia interaction to a user agent. The two common hypermedia controls are anchors and forms. htmx simply generalizes this concept, allowing any element to be a hypermedia control, issuing any sort of HTTP request, in response to any sort of event and replacing any element in the DOM. I have written an essay on an alternative software design principle to the traditional separation of concerns that we see in web development here: https://htmx.org/essays/locality-of-behaviour/ https://htmx.org/essays/locality-of-behaviour/
- flagrant_taco 3y agoWhere in the spec for html did it specify that it's isn't meant to be dynamic? HTMX effectively used js for a polyfill of potential html standards, very similar to using babel or postcss to prototype a proposed spec.
- roywiggins 3y agoA lot of htmx is just a smoother version of what people used to do with forms and iframes.