https://htmx.org logo
Join Discord
Powered by
# htmx-general
  • a

    abundant-spring-38265

    09/09/2022, 7:18 PM
    ๐Ÿ‘
  • a

    abundant-spring-38265

    09/09/2022, 7:35 PM
    here is the snippet:
  • a

    abundant-spring-38265

    09/09/2022, 7:36 PM
    and here is the response, regardless of what's selected:
  • a

    abundant-spring-38265

    09/09/2022, 7:37 PM
    p.s i tried to see whether data-hx-disable changes anything :/
  • n

    numerous-garden-69863

    09/09/2022, 8:27 PM
    Hi guys. I just learned Django and want to build a project like a clone of Reddit, is knowing Django + HTMX enough? I know HTML and CSS obviously and also JavaScript, but not react or other front end frameworks, except Bootstrap
  • m

    mammoth-family-48524

    09/09/2022, 9:59 PM
    Yes. Youโ€™ll get pretty far with just Django and HTMX.
  • r

    refined-waiter-90422

    09/09/2022, 10:49 PM
    Dodged a bullet with the vue man, lol. Good stuff.
  • r

    refined-waiter-90422

    09/09/2022, 10:50 PM
    Even Django alone would be enough, but if you want to have modern buttery smoothness, HTMX is the way.
  • a

    ancient-shoe-86801

    09/09/2022, 10:59 PM
    there is a PR open for that ๐Ÿคž
  • a

    ancient-shoe-86801

    09/09/2022, 11:01 PM
    https://github.com/bigskysoftware/htmx/pull/1035
  • a

    ancient-shoe-86801

    09/09/2022, 11:02 PM
    lol, was merged a few seconds ago ๐Ÿ˜„
  • a

    ancient-father-3063

    09/10/2022, 8:15 AM
    Sorry but is anyone around that can help me understand how to debug or look at htmx logs?
  • a

    ancient-father-3063

    09/10/2022, 8:16 AM
    I see in the docs it says to use "htmx.logAll();"
  • a

    ancient-father-3063

    09/10/2022, 8:16 AM
    but I'm kinda new and I don't understand how to use this, or otherwise view htmx logs
  • r

    ripe-action-67367

    09/10/2022, 9:45 AM
    Just call this method from your code or browser console
  • r

    ripe-action-67367

    09/10/2022, 9:45 AM
    htmx will log every event after that
  • m

    miniature-lizard-24702

    09/10/2022, 2:16 PM
    feelsbadman, theres no offtopic channel
  • m

    miniature-lizard-24702

    09/10/2022, 2:16 PM
    ๐Ÿฅฒ
  • m

    mysterious-toddler-20573

    09/10/2022, 2:28 PM
    #974086000307499028
  • m

    miniature-lizard-24702

    09/10/2022, 2:44 PM
    oh...
  • m

    miniature-lizard-24702

    09/10/2022, 2:44 PM
    ๐Ÿ˜…
  • w

    wonderful-shampoo-13605

    09/11/2022, 7:36 AM
    Is there a way to append
    sse
    messages to a html element, kind of how the
    afterbegin
    etc swap methods work? I'd like to receive
    sse
    events and append them to a list, rather than continuously replace the same element
  • b

    bland-coat-6833

    09/11/2022, 8:48 AM
    So I use
    afterbegin
    with SSE. Sounds like you want
    beforeend
    to append to a list
  • h

    happy-monitor-48276

    09/11/2022, 11:42 AM
    I am trying to do hx-swap-oob but keeps on getting
    htmx:swapError
    , in response i am targeting the element by id and using the same id in base tag as well.
  • b

    bland-coat-6833

    09/11/2022, 11:45 AM
    Might need to see what youโ€™re sending back and what your htmx looks like.
  • h

    happy-monitor-48276

    09/11/2022, 11:47 AM
    Here we go https://linkode.org/#I8jFBtjNveWRh6JL7T0hm5
  • h

    happy-monitor-48276

    09/11/2022, 11:54 AM
    I am using 1.6.1 version, though i tried 1.8.0 but i think something else is off
  • a

    ancient-shoe-86801

    09/11/2022, 5:41 PM
    last night I started thinking on something that had me worried. With HTMX, it seems a common pattern is to have the same route of the backend return two different payloads. If the
    HX-Request
    header is present on the request the response is only a fragment of the HTML, otherwise the response is the full page. This allows pushing the URL of the fragment to the navigation bar, and be able to share that URL with somebody, navigation back/forward, etc. All the goodness of having a working route for the full page, but that we can also use for partial updates. That let me to think that having two different responses defined only by the existence of a header disables two of the most basic HTTP cache mechanisms: the Last-Modified/If-Modified-Since and ETags. The browser cannot tell between a request with
    HX-Request
    and one without, so the response cannot be cached as the wrong one could be used (for example, the browser wants to load the full page but it has only the partial cached). Any thoughts about this?
  • a

    ancient-shoe-86801

    09/11/2022, 5:46 PM
    Exmaple: create a simple page with a link to itself, and an HTMX powered button with an
    hx-get
    also to itself, but with a target of some div on the page. Then have a backend with that single page, either returning the full page or only the div, depending on the HX-Request header. Also, have that backend return a hard-coded last-modified on the response, and if it gets a If-Modified-Since return a 304. Then: 1. Load the page for the first time. 2. Click the button to trigger a partial update. The response will include a last-modified. 3. Click button again. The request will include a If-Modified-Since, so the backend will return a 304, and the cached partial response will load. 4. Now click the link. Again, the request will include a If-Modified-Since, so the backend will return a 304, and the cached partial response will load. Sad faces because we wanted the full html this time.
  • m

    mysterious-toddler-20573

    09/11/2022, 6:20 PM
    headers are part of the cache key, iirc
1...822823824...1146Latest