DEV Community

Cover image for Simple Introduction To HTMX

Simple Introduction To HTMX

Ethan on March 17, 2024

Introduction Hello! 😎 In the ever-evolving landscape of web development, where the lines between server and client-side scripting blur,...
Collapse
 
imthedeveloper profile image
ImTheDeveloper

Yep really like htmx. I added alpine.js for the small bits of interactivity I need where it would be overkill to talk to the server

Collapse
 
ethand91 profile image
Ethan

I didn't know about alphine! Thanks for telling me, I'll give it a look :)

Collapse
 
clsource profile image
Camilo

HTMx is a good tool but it lacks several other functionalities, in my opinion is just jQuery improved.

If you are curious about functional programming I highly recommend Elixir and Phoenix LiveView.

reddit.com/r/elixir/comments/198cg...

Here is an interview with Jose and he talks about HTMx and Hotwire meaning that they are Imperative tools.

Collapse
 
ansonnn07 profile image
Ansonnn

If everything is in HTML, wouldn't the user be able to make changes to the HTML to change especially things like a PHP script to trigger? It seems dangerous if the random script name somehow triggered something in the backend

Collapse
 
pontakornth profile image
Pontakorn Paesaeng

If user can make HTML, that would be vulnerable. Usually, there is an escaping feature on most common templating languages anyway. Escaping the user content would be enough to prevent that.

If some HTML or anything rendered to HTML is necessary, the developers need to allow only safe attributes. It is like how to prevent XSS in traditional web applications.

Collapse
 
arturstorsters profile image
Artūrs

good point