Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Htmx (htmx.org)
8 points by colinprince on Jan 2, 2022 | hide | past | favorite | 2 comments


it now feels wrong to me to have behavior in HTML markup.

i get it, it's easy and simple. and has worked for many frameworks. but things like that are bound to be abused and i am already seeing traces of such abuse in the examples:

    <form hx-encoding='multipart/form-data' hx-post='/upload'
          _='on htmx:xhr:progress(loaded, total) set #progress.value to (loaded/total)*100'>
    ...
maybe we should leave markup for HTML, styling for CSS, and behavior for JavaScript, TypeScript or similar.


this is a mix of two technologies: htmx and hyperscript

The second attribute (with the code) is hyperscript:

https://hyperscript.org

The first two attributes are htmx and are pure declarative markup, which is the idea with htmx. htmx and hyperscript are designed to work well together, as this demo shows, but they are separate concepts and htmx tries very hard to stay within the original hypermedia model.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: