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

    ripe-ghost-5606

    04/20/2023, 10:44 AM
    A built in way to handle errors would be 10/10
  • b

    bland-coat-6833

    04/20/2023, 11:21 AM
    Could probably do something with
    hx-on
    now
  • g

    gray-zebra-72301

    04/20/2023, 7:44 PM
    Hello. I want to load and show some content in a modal. Does it make any difference in performance if I create a whole html page and
    hx-select
    the content to insert inside the modal, vs returning this content as an html fragment?
  • w

    white-motorcycle-95262

    04/20/2023, 8:06 PM
    Possibly, if e.g. the whole html page requires a ton of database hits or other things that are not necessary for the content in the modal
  • w

    white-motorcycle-95262

    04/20/2023, 8:13 PM
    Shouldn't the following work when
    select
    input inside the form are changed? I'm not getting anything 🤷‍♂️ I also tried
    "change from:select"
    Copy code
    <form
      id="my_id"
      method="post"
      hx-trigger="change"
      hx-target="#table"
    >[...]</form>
  • g

    gray-zebra-72301

    04/20/2023, 8:36 PM
    The html page would contain exactly the same content as the fragment, minus the standard html, head, body etc, tags. I guess the performance should be the same.
  • m

    magnificent-boots-1658

    04/20/2023, 10:15 PM
    @mysterious-toddler-20573 -- the autofocus issue for me was that I had it enabled on a different field that was preempting the field I was trying to opt into autofocus on HTMX-load
  • m

    mysterious-toddler-20573

    04/20/2023, 10:15 PM
    mmm
  • c

    crooked-pharmacist-82696

    04/20/2023, 11:15 PM
    So, here’s someone that is interested in htmx from Montana! Let’s go!
  • m

    mysterious-toddler-20573

    04/20/2023, 11:19 PM
    based and snow-pilled
  • m

    mammoth-family-48524

    04/21/2023, 12:38 AM
    I’ve been doing this by always (usually 😉) setting the hx attributes with values that assume success, and then on the server side, if the form is invalid, I use the hx header attributes to change what HTMX should do with the response - swap method and target mostly. I think it’s working pretty well.
  • k

    kind-barista-83726

    04/21/2023, 2:22 PM
    complete noob question - could I use htmx to 'enhance' a static site built with Hugo?
  • o

    orange-umbrella-16693

    04/21/2023, 2:29 PM
    Interesting approach!
  • m

    mysterious-toddler-20573

    04/21/2023, 2:34 PM
    yep
  • k

    kind-barista-83726

    04/21/2023, 2:35 PM
    Thanks
  • g

    great-cartoon-12331

    04/21/2023, 3:19 PM
    yes, but you would need a server that serves HTML fragments for htmx to work. actually you could even put static HTML fragments in their own files, on the same server as the rest of your site, and get htmx to fetch and swap those into pages. the more dynamic the behaviour, the more you need an application server.
  • b

    bitter-machine-55943

    04/21/2023, 4:27 PM
    Anyone have rules of thumb for when you use HTMX/Hyperscript/Alpine? Seems like you can use all 3 to accomplish similar goals
  • m

    mysterious-toddler-20573

    04/21/2023, 4:40 PM
    htmx when you can accomplish your desired UX via pure hypermedia interactions without too much jankyness alpine.js/hyperscript for pure front end functionality such as toggling classes/visilibity alpine.js/hyperscript/vue.js/etc. for islands of interactivity where the front end needs exceed what hypermedia can handle picking between alpine.js/hyperscript: alpine.js if you are sane hyperscript otherwise
  • b

    bitter-machine-55943

    04/21/2023, 5:11 PM
    I think jankyness was defined in Roy Fielding’s original paper
  • m

    mysterious-toddler-20573

    04/21/2023, 6:42 PM
    LADS

    https://cdn.discordapp.com/attachments/725789747212976259/1099042618291269662/image.png▾

  • m

    mysterious-toddler-20573

    04/21/2023, 6:43 PM
    I AM OFFICIALLY DECLARING MY CANDIDACY FOR THE CEO OF HTML
  • m

    miniature-lizard-24702

    04/21/2023, 6:49 PM
    😱
  • r

    refined-waiter-90422

    04/21/2023, 6:56 PM
    Nice- already the CEO of HTML in some regards, just making the title official. 😉
  • m

    mysterious-toddler-20573

    04/21/2023, 6:59 PM
    i view the selection process as a mere formality
  • k

    kind-barista-83726

    04/21/2023, 7:08 PM
    OK thanks for the heads up - I'm just 'testing' right now
  • g

    great-cartoon-12331

    04/21/2023, 7:54 PM
    you're already the CEO of htmx, if they don't make you the CEO of HTML that's their L!
  • m

    mysterious-toddler-20573

    04/21/2023, 8:00 PM
    only facts detected
  • q

    quick-lamp-41411

    04/21/2023, 8:12 PM
    Is there a reason there's a difference in the way afterX events are raised between normal events and the events triggered via response headers?
  • m

    mysterious-toddler-20573

    04/21/2023, 8:31 PM
    tell me more
  • q

    quick-lamp-41411

    04/21/2023, 8:33 PM
    https://github.com/bigskysoftware/htmx/blob/master/src/htmx.js#L3348
1...109911001101...1146Latest