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

    gorgeous-airport-54386

    09/21/2022, 4:42 AM
    it is a disgrace that i can't get a masters in html
  • a

    aloof-crayon-56651

    09/21/2022, 4:43 AM
    I want a PhD in CSS.
  • b

    blue-ghost-19146

    09/21/2022, 2:09 PM
    I've started getting quite a few `htmx:historyCacheError`s in the browser console after various requests (
    HX-Push
    header is being used). Are there any common reasons why this may occur or useful ways of seeing the cause of the error in more detail? My guess is that the size of the content on the page is too large for it to be cached, but I have no real reasoning behind that.
  • g

    gifted-appointment-5037

    09/21/2022, 5:07 PM
    After getting hooked on HTMX I decided to make a full stack framework from it using Express. Please have a go, make suggestions etc hacked it together in 2 days, so itโ€™s rough around the edges. But Iโ€™m quite enjoying playing with it so far. The idea is that it is config free, and relies on a sort of NextJS server side routing structure to define all the endpoints. And Mustache to render the htmx that is served. Iโ€™ll be coding up some examples shortly. https://www.npmjs.com/package/htmxx
  • e

    echoing-dress-67727

    09/21/2022, 6:19 PM
    With the
    throttle
    option on
    hx-trigger
    , can that be applied across multiple events? For example, I want to trigger a request whenever a click or a
    mousemove
    ,
    touchstart
    , or
    scroll
    action happens, but I want to throttle all of those collectively, so that requests fire no more than every 30ms.
  • e

    echoing-dress-67727

    09/21/2022, 6:20 PM
    I think I can do that manually with the event filters, like
    hx-trigger="mousemove[checkForGlobalThrottle()], touchstart[checkForGlobalThrottle()], scroll[checkForGlobalThrottle()]"
    but I'm hoping there's a cleaner way
  • e

    echoing-dress-67727

    09/21/2022, 6:22 PM
    Also, separate question, can I have multiple separate triggers associated with separate requests? For example, on one element, could I have a
    click
    send one request, and a
    mouseover
    send another request?
  • a

    ancient-shoe-86801

    09/22/2022, 1:00 AM
    Shoot I got spoiled. I now find easier to do things with native HTML (+ htmx) with some sprinkled hyperscript than dealing with a fancy-library component and Angular.
  • e

    echoing-dress-67727

    09/22/2022, 2:06 AM
    When using
    htmx.ajax
    , is there a way to add a callback for errors, just for that request?
  • e

    echoing-dress-67727

    09/22/2022, 2:06 AM
    I know I can set up a listener for
    htmx:responseError
    on that element, but that would catch all instances of htmx errors on that element. I just want to set it up temporarily, for that one request
  • e

    echoing-dress-67727

    09/22/2022, 2:07 AM
    I thought I'd be able to do it by chaining
    .then()
    , but it seems no data gets passed to that callback. Same for
    catch()
    .
  • e

    elegant-raincoat-69176

    09/22/2022, 5:50 AM
    Anyone know if I can use Idiomorph to clone the options in one select to another select?
  • e

    elegant-raincoat-69176

    09/22/2022, 5:51 AM
    Hmmm... we may need a channel for Idiomorph ๐Ÿ™‚
  • e

    elegant-raincoat-69176

    09/22/2022, 5:59 AM
    Also might somewhat be overkill for what I need. Reexamining my problem.
  • p

    proud-librarian-99598

    09/22/2022, 9:17 AM
    Has this issue been created/implemented? I could use
    htmx:redirectReceived
    to force a full page reload when it happens (Usually when the user is no longer logged on).
  • t

    tall-dinner-62086

    09/22/2022, 11:08 AM
    Does the idiomorph extension work for oob swaps?
  • t

    tall-dinner-62086

    09/22/2022, 11:13 AM
    hmm initial tests are throwing "too much recursion". I'll need to look at this in more detail
  • t

    tall-dinner-62086

    09/22/2022, 11:22 AM
    I clearly have no clue how to use idiomorph. I tried swapping the whole body instead of using the oob I was doing and it just nuked my entire DOM
  • t

    tall-dinner-62086

    09/22/2022, 11:23 AM
    wait no, that's not an idiomorph issue
  • f

    flat-painting-36912

    09/22/2022, 1:38 PM
    Hey everyone
  • f

    flat-painting-36912

    09/22/2022, 1:38 PM
    How can I run some javascript when the AJAX request completes?
  • f

    flat-painting-36912

    09/22/2022, 1:38 PM
    Copy code
    html
        <select class="selectpicker form-control" hx-post="{% url 'hypervisors' %}" hx-target="#hypervisor-select"
            id="region-select" name="region" hx-trigger="change">
            <option disabled selected>Choose region</option>
            {% for region in regions %}
            <option value="{{ region }}">{{ region }}</option>
            {% endfor %}
        </select>
  • f

    flat-painting-36912

    09/22/2022, 1:39 PM
    So for example when #hypervisor-select has been replaced by HTMX, I'd like to run some javascript. Is this built in?
  • w

    worried-portugal-65416

    09/22/2022, 2:33 PM
    I think you can listen to the htmx:afterSwap event
  • f

    flat-painting-36912

    09/22/2022, 3:57 PM
    thx ๐Ÿ™‚
  • m

    mysterious-toddler-20573

    09/22/2022, 4:16 PM
    you need help with this?
  • m

    mysterious-toddler-20573

    09/22/2022, 4:16 PM
    idiomorph is.... quite new.
  • t

    tall-dinner-62086

    09/22/2022, 4:16 PM
    I will, tomorrow. Currently working on a different project
  • m

    mysterious-toddler-20573

    09/22/2022, 4:16 PM
    roger, I will be available in the morning MST
  • t

    tall-dinner-62086

    09/22/2022, 4:16 PM
    The DOM nuke wasn't idiomorph though, it was happening with
    outerHTML
    too
1...832833834...1146Latest