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

    salmon-church-58191

    08/13/2022, 7:07 PM
    looks like the last paren was there.
  • s

    salmon-church-58191

    08/13/2022, 7:07 PM
    This is really helpful, though... learning to troubleshoot from the console.
  • s

    salmon-church-58191

    08/13/2022, 7:08 PM
    SyntaxError: Unexpected EOF evaluateWithScopeExtension (anonymous function) _wrapCall
  • s

    salmon-church-58191

    08/13/2022, 7:09 PM
    _hyperscript alone in the console produces function (e,t){return y.evaluate(e,t)}
  • s

    salmon-church-58191

    08/13/2022, 7:10 PM
    aha... hang on... tried a Brave browser instance and got an error.
  • s

    salmon-church-58191

    08/13/2022, 7:10 PM
    hyperscript errors were found on the following element: <button hx-get=​"/​contact/​1/​edit" hx-trigger=​"edit" _=​"on click if .editing is not empty Swal.fire({title:​ 'Already Editing', showCancelButton:​ true, confirmButtonText:​ 'Yep, Edit This Row!', text:​'Hey! You are already editing a row! Do you want to cancel that edit and continue?'}​)​ if the result's isConfirmed is false halt end send cancel to .editing end" class=​"btn btn-danger">​Edit​​ Expected 'end' but found 'Swal' Swal.fire({title: 'Already Editing', ^^ Error: Expected 'end' but found 'Swal' Swal.fire({title: 'Already Editing', ^^ at Object.c [as raiseParseError] (https://unpkg.com/hyperscript.org@0.9.3:1:9498) at a (https://unpkg.com/hyperscript.org@0.9.3:1:4237) at Object.requireToken (https://unpkg.com/hyperscript.org@0.9.3:1:5598) at https://unpkg.com/hyperscript.org@0.9.3:1:60551 at a (https://unpkg.com/hyperscript.org@0.9.3:1:11525) at https://unpkg.com/hyperscript.org@0.9.3:1:9939 at https://unpkg.com/hyperscript.org@0.9.3:1:8972 at Object.i [as parseElement] (https://unpkg.com/hyperscript.org@0.9.3:1:9084) at https://unpkg.com/hyperscript.org@0.9.3:1:10136 at https://unpkg.com/hyperscript.org@0.9.3:1:8972 S @ hyperscript.org@0.9.3:1 DevTools failed to load source map: Could not load content for https://unpkg.com/_hyperscript_web.min.js.map: HTTP error: status code 403, net::ERR_HTTP_RESPONSE_CODE_FAILURE
  • g

    gorgeous-airport-54386

    08/13/2022, 7:12 PM
    can you upgrade to 0.9.7?
    s
    • 2
    • 35
  • s

    salmon-church-58191

    08/13/2022, 7:12 PM
    definitely, stand by.
  • s

    salmon-church-58191

    08/13/2022, 7:15 PM
    where should I paste errors in discord, btw... in Slack there's threaded conversations... is this cool?
  • s

    salmon-church-58191

    08/13/2022, 7:16 PM
    doh... found 'create thread', I'll use that.
  • s

    salmon-church-58191

    08/13/2022, 8:59 PM
    @gorgeous-airport-54386 sorted out my confusion... thank you!! 😀 👍
  • s

    salmon-church-58191

    08/13/2022, 9:00 PM
    And I learned a lot on the way.
  • s

    salmon-church-58191

    08/13/2022, 10:54 PM
    Side note: the htmx docs are fantastic, with working interactive examples as well as the server calls and responses at the bottom... so grateful.
  • s

    salmon-church-58191

    08/13/2022, 10:54 PM
    And loving sweetalert2.
  • m

    mysterious-toddler-20573

    08/13/2022, 11:45 PM
    🙂 great to hear
  • b

    brave-dog-98297

    08/14/2022, 5:13 AM
    can anyone please help with hx-target? I'd like to target a parent element using a class. I tried hyperscript with fetch which is brilliant at it, but when it comes to fetch with method:"POST" the csrf tokens don't get sent using code on the body tag or using on fetch:beforeRequest(headers), so I only get a forbidden response. htmx send the tokens correctly but I can't seem to be able to target the correct element (these element are rendered in a for loop so id's are out)
  • a

    abundant-fountain-92652

    08/14/2022, 11:50 AM
    Hi. I have tree-menu ( inside ). At the root of the tree, I want to remove a class
    .focus
    from all
    <li/>
    and re-attach the
    .focus
    class to the target with:
    _on="on click remove .focus from <li/> in #sidenav-left then add .focus to closest parent of the target"
    , however that produces an error
    Expected a CSS expression
    for
    closest parent of the target
    .
  • g

    gorgeous-airport-54386

    08/14/2022, 11:51 AM
    closest parent of the target
    -- what do you want this to return?
  • a

    abundant-fountain-92652

    08/14/2022, 11:51 AM
    Target is an
    a
    that is inside a
    <li/
    , i want to add
    .focus
    to this
    <li/>
    .
  • g

    gorgeous-airport-54386

    08/14/2022, 11:52 AM
    closest <li /> to target
  • a

    abundant-fountain-92652

    08/14/2022, 11:54 AM
    Man, genius!!
  • a

    abundant-fountain-92652

    08/14/2022, 11:54 AM
    Tx.
  • c

    colossal-controller-54041

    08/14/2022, 5:51 PM
    Hi folk. Is it possible to issue a post request on the window resize event with throttle? I've tried to do smth like
    hx-trigger="resize from:window throttle:300ms"
    , but it doesn't work. Thanks.
  • m

    mysterious-toddler-20573

    08/14/2022, 6:31 PM
    does it work w/o the throttle?
  • m

    mysterious-toddler-20573

    08/14/2022, 6:35 PM
    https://codepen.io/1cg/pen/qBoJoMj?editors=1000
  • m

    mysterious-toddler-20573

    08/14/2022, 6:35 PM
    This appears to be working for me
  • m

    mysterious-toddler-20573

    08/14/2022, 6:36 PM
    I like using "delay" rather than "throttle" so we wait for the window to settle down
  • c

    colossal-controller-54041

    08/14/2022, 8:10 PM
    It works in both ways, the issue was an outdated version of HTMX. Thanks!
  • a

    aloof-crayon-56651

    08/15/2022, 1:04 AM
    My dad still uses his @aol.com address.
  • d

    delightful-student-39557

    08/15/2022, 8:51 AM
    Browser back button causes naked partial view in Django? Has anyone come across this before? I already have if statement in my view to check if it’s htmx request or normal request. This works when I load the pages separately but browser back button still renders naked partial view.
1...778779780...1146Latest