logoalt Hacker News

bullentoday at 1:28 PM2 repliesview on HN

What is the advantage over just using this:

  var source = new EventSource('pull?name=one');
  source.onmessage = function (event) {
    document.getElementById('events').innerHTML += event.data;
  };
http://talk.rupy.se/event.html

> If you need bi-directional communication, then you should consider using WebSockets instead.

Or you just do a HTTP request?


Replies

anamexistoday at 3:39 PM

Everything HTMX does could be "just" done using JS - this is self-evident. The whole point of HTMX is to enable features like this directly in HTML.