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

    refined-waiter-90422

    11/24/2022, 7:15 AM
    Its legit lol
  • r

    refined-waiter-90422

    11/24/2022, 7:16 AM
    Use that WAL mode tho
  • o

    orange-nail-40296

    11/24/2022, 7:27 AM
    I don’t have a web application, I just have a frontend making requests to a SQLite database on
    .mode html
    😂
  • l

    loud-shampoo-68610

    11/24/2022, 7:28 AM
    This isn't exactly HTMX specific, but having started learning web development, a gap in my understanding is still definitely what it takes to take an application made with web tech (like htmx and a back end) and get it to run on mobile devices, and be allowed in app stores. It seems like there are some options like Ionic Capacitor and Cordova that make this possible, but I don't understand what these really add or why they're required to get a web-stack application running on mobile? I know they offer the ability to define separate components that look like the native components of each respective target platform, but say you didn't need everything to look different on different platforms, what else is needed to run a web tech application on mobile? I've also had a hard time understanding specifically what's allowed on the Apple store, as it seems there is a lot of conflicting info on that Apple doesn't allow SPAs, but how would something made with Cordova or Capacitor be any different? I've been playing with making some things using HTMX and Biff (a lightweight Clojure back end) and wanted to assess if it is possible to run it on other platforms, or if I needed to look at something totally different like .NET's Blazor/ Bolero that can run C# or F# via Web Assembly or inside of their new .NET Maui platform (which again I don't totally understand what it adds.) I love HTMX so far, but am looking for a way to apply one core language to the farthest possible reach (web / mobile / desktop) with a similar code base. Hoping to use HTMX, otherwise will probably go with either Blazor + Maui or a Quasar front end. Thanks!
    o
    m
    b
    • 4
    • 12
  • o

    orange-nail-40296

    11/24/2022, 7:53 AM
    Mobile
  • b

    boundless-leather-51644

    11/24/2022, 4:37 PM
    Hi
  • b

    boundless-leather-51644

    11/24/2022, 4:38 PM
    What do you suggest todo if I must change this property to submit a HTTP Post
    HX-Current-URL
    from a HTML Form page ?
  • s

    some-airline-73512

    11/24/2022, 4:51 PM
    How to include event details in request? I tried this but the event is undefined:
    Copy code
    applescript
    hx-vals='js:{"width":event.width}'
  • s

    some-airline-73512

    11/24/2022, 4:52 PM
    Event is triggered in the script:
    Copy code
    applescript
    script="on mutation send resize(width: event.target.style.width)"
  • r

    ripe-action-67367

    11/24/2022, 5:11 PM
    i believe it's event.details.width
  • r

    ripe-action-67367

    11/24/2022, 5:12 PM
    or event.detail.width
  • r

    ripe-action-67367

    11/24/2022, 5:12 PM
    i can never remember if it's plural
  • s

    some-airline-73512

    11/24/2022, 5:12 PM
    event is undefined
  • r

    ripe-action-67367

    11/24/2022, 5:12 PM
    oh right
  • r

    ripe-action-67367

    11/24/2022, 5:18 PM
    Copy code
    html
    <script src="https://demo.htmx.org"></script>
    
    <button hx-get="/foo" hx-trigger="resize" hx-vals='js:{"el":event.detail.el}' hx-target="#out" _="on click send resize(el: event.target.tagName)">send</button>
    
    <output id="out"></output>
    
    <template url="/foo">alsdfkj ${el}</template>
  • r

    ripe-action-67367

    11/24/2022, 5:19 PM
    well this works
  • r

    ripe-action-67367

    11/24/2022, 5:19 PM
    not sure why event would be undefined in your case
  • r

    ripe-action-67367

    11/24/2022, 5:20 PM
    are there any logs?
  • s

    some-airline-73512

    11/24/2022, 5:20 PM
    You are right, it works. But for some reason event was showing as undefined
  • s

    some-airline-73512

    11/24/2022, 5:20 PM
    Thank you @ripe-action-67367
  • b

    boundless-leather-51644

    11/24/2022, 5:33 PM
    Is there a way to troubleshoot error HTTP 400 ?
  • b

    boundless-leather-51644

    11/24/2022, 5:42 PM
    I included an
    edit
    button in a screen
    Copy code
    <li class="list-inline-item">
                    <button class="btn btn-success btn-sm rounded-2" type="button"
                            title="Edit"
                            href="/credentials/credential/{credential.id}"
                            hx-get="/credentials/credential/{credential.id}"
                            hx-replace-url="/credentials/new"
                            hx-push-url="false"
                            hx-swap="outerHTML"
                            hx-target="#base">Edit</button>
                </li>
    containing a list of items. The beginning of the HTML page includes a
    <div id="base"
    that I use to replace using
    hx-swap=outerHTML
    the content (= HTML Form content) returned from a HTTP Get. Visually, I see the form with the fields to be edited witin my browser but If I look to the source (= HTML Page source), the HTML that I got is the HTML of the screen including the list of the items and not he Form. What should I do to get the proper HTML ?
  • b

    boundless-leather-51644

    11/24/2022, 5:55 PM
    Fixed after
    hx-push-url="false"
    ->
    hx-push-url="true"
  • b

    boundless-leather-51644

    11/24/2022, 9:28 PM
    How can I fix such HTTP 400 error ?
  • m

    mysterious-toddler-20573

    11/24/2022, 9:32 PM
    What is your back end?
  • t

    thankful-apartment-66679

    11/25/2022, 3:23 AM
    has anyone done any work with htmx using cloudflare workers?
  • f

    fresh-lighter-53021

    11/25/2022, 6:48 AM
    i am using
    slick
    by
    kenwheeler
    for a carousel in a django school project. Currently i am trying to implement an infinite scroll and i am able to do so but when new contents are added to they are not 'carouseled'. I know i need to initialize
    slick
    again using
    htmx.onLoad
    but it didn't worked. So far i did this
    Copy code
    htmx.onLoad(function(document) {
    	$('.post-meta').slick({
    		dots: true,
      		infinite: true,
      		speed: 300,
      		slidesToShow: 1,
      		adaptiveHeight: true
        });
    })
  • f

    fresh-lighter-53021

    11/25/2022, 6:48 AM
    But it's just not working
  • f

    fresh-lighter-53021

    11/25/2022, 6:48 AM
    Can anyone help ?
  • f

    freezing-waitress-26396

    11/25/2022, 6:53 AM
    The jquery selection needs to target a parent of the dynamically swapped element iirc
    Copy code
    $('parent-selector').on('event-name','child-selector', function() {
    // Statement
    });
1...921922923...1146Latest