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

    big-airline-13935

    12/07/2022, 2:15 AM
    Why would it not work with htmx?
  • w

    white-motorcycle-95262

    12/07/2022, 2:16 AM
    My understanding (which is admittedly very shallow) is that Google requires the gtag to be on every page to capture activity. Since the tag would presumably only be loaded once, and not with fragments during e.g. an hx-boost, that activity might not get logged?
  • b

    big-airline-13935

    12/07/2022, 2:20 AM
    If your question is specific to boosting pages then there is lots of literature out there on how to make Google Analytics work with SPA's which would apply here too. One such example is https://tech.webinterpret.com/how-to-make-google-analytics-work-in-a-single-page-application-spa/
  • w

    white-motorcycle-95262

    12/07/2022, 2:20 AM
    Thanks 🙂
  • b

    big-airline-13935

    12/07/2022, 2:22 AM
    At its simplest, it will involve manually registering a page view.
    Copy code
    js
    window.ga('send', 'pageview', location.pathname);
    But according to that article, there's an easier way via Google Tag Manager.
  • w

    white-motorcycle-95262

    12/07/2022, 2:22 AM
    Yeah, I figured it would involve something where I listen for
    htmx.onLoad
  • w

    white-motorcycle-95262

    12/07/2022, 2:23 AM
    Oh wait, that Tag Manager seems a lot easier
  • w

    white-motorcycle-95262

    12/07/2022, 2:26 AM
    Thanks 🙂
  • w

    white-motorcycle-95262

    12/07/2022, 2:28 AM
    Actually, so it looks like detecting history change might be enabled in the new version of GA by default.
  • b

    bumpy-kangaroo-60192

    12/07/2022, 2:29 AM
    i feel i have gone down a dark path.... htmx on links in svg
  • b

    bumpy-kangaroo-60192

    12/07/2022, 2:32 AM
    HTMX is not preventing default on the events because svg is case sensitive and the browser is therefore reporting the element's tagName as "a", so I am writing an extension to hopefully just call preventDefault on the event
  • b

    bumpy-kangaroo-60192

    12/07/2022, 2:35 AM
    i'm really enjoying HTMX but i'm doing a lot of weird stuff and not sure if i'm finding bugs or if i've actually messed up my htmx.js file
  • m

    mysterious-toddler-20573

    12/07/2022, 3:47 AM
    sounds interesting! please don't be afraid to explore and ask questions, the code base isn't that big!
  • b

    bumpy-kangaroo-60192

    12/07/2022, 4:13 AM
    the site i am working on has a web component, so i have modified htmx to work with a shadow root. the modification i made was pretty simple but i don't think y'all would be interested in these changes as require writing javascript to instantiate an htmx instance with a root element
  • b

    bumpy-kangaroo-60192

    12/07/2022, 4:15 AM
    but after working out some kinks and getting the responses ironed out, the web component basically works.. i was pretty pleased
  • b

    bumpy-kangaroo-60192

    12/07/2022, 4:17 AM
    supporting the web component made my django code get kinda ugly, but it's getting back the way it's supposed to be, clean views and templates
  • l

    lemon-rocket-71964

    12/07/2022, 3:18 PM
    Swap html fragment load is fast at first call, sub sequent calls html fragment load at client longer than first time. Looks like swap will go through all the elements recursively and remove. Is there any way we can replace without recursive?
  • m

    mysterious-toddler-20573

    12/07/2022, 6:47 PM
    which swap are you using? can you give us a sense of the target content before and after? are you comfortable w/ profiling in Chrome?
  • h

    hundreds-camera-24900

    12/07/2022, 8:02 PM
    Thoughts on switching scrollBehavior default to auto from smooth?
  • h

    hundreds-camera-24900

    12/07/2022, 8:02 PM
    100% of the designers I've run it by do not like the smooth, and I think auto is closer to non-boosted behavior
  • m

    mysterious-toddler-20573

    12/07/2022, 8:07 PM
    def possible for 2.0
  • h

    hundreds-camera-24900

    12/07/2022, 8:08 PM
    do we have a 2.0 branch yet or should I throw against dev?
  • m

    mysterious-toddler-20573

    12/08/2022, 1:08 AM
    No 2.0 branch yet
  • h

    hundreds-camera-24900

    12/08/2022, 1:17 AM
    alright, tossed it up against dev with a note to wait until 2.0
  • v

    victorious-thailand-80225

    12/08/2022, 3:40 AM
    Hi, I have a websock created with htmx. After a while, it closes with reason : "Connection idle timeout". There's no client->backend messages yet. All I do is send oob messages from backend to client. Is this a reason? Server is Jetty (Using Clojure)
    r
    • 2
    • 3
  • t

    thankful-addition-60522

    12/08/2022, 10:14 AM
    oh exploitable
  • r

    refined-waiter-90422

    12/08/2022, 10:33 AM
    if you're allowing your users to insert their own javascript in the first place, you're gonna have XSS issues. You're better off having an attribute whitelist if you're allowing HTML as user input at all.
  • r

    refined-waiter-90422

    12/08/2022, 10:33 AM
    re: @thankful-addition-60522
  • t

    thankful-addition-60522

    12/08/2022, 10:34 AM
    just do a
    sanitize()
  • r

    refined-waiter-90422

    12/08/2022, 10:35 AM
    on the server maybe, dunno what api that is from.
1...935936937...1146Latest