💭 </> htmx ~ Locality of Behaviour (LoB)

!https://htmx.org/essays/locality-of-behaviour/

Interesting principle here. What a great example, If I’m looking at the second jQuery example, I have to dig into dev tools or make some assumtions that this team uses jQuery, and selects by id, therefore I can grep for $("#d1").

Consider two different implementations of an AJAX request in HTML, the first in htmx:

<button hx-get="/clicked">Click Me</button>


> and the second in jQuery:

``` js
  $("#d1").on("click", function(){
    $.ajax({
         /* AJAX options... */
    });
  });
<button id="d1">Click Me</button>

Note

This post is a thought. It’s a short note that I make about someone else’s content online #thoughts

Connections

Related tags and posts connected to this entry.