Martin Lefebvre's blog

Learning

HTMX: Simple AJAX

We all remember AJAX (Asynchronous JavaScript and XML). I’ve spent many hours and many days creating XMLHttpRequest objects and using jQuery’s .get and .post methods to connect HTML to a PHP backend to achieve that true “no full page load” magic. That’s still possible today… It’s also even simpler with HTMX, a small library that makes HTML dynamic. At its most basic, HTMX queries endpoints and updates HTML elements with the returned content (usually text or HTML).