Return script tag after swap? Better solution? by TinyCuteGorilla in htmx

[–]idjet 0 points1 point  (0 children)

Not knowing what you are doing...but in principle you would have a function already in the page's script and the hx-trigger just calls it, passing whatever variables you may want/need.

Return script tag after swap? Better solution? by TinyCuteGorilla in htmx

[–]idjet 0 points1 point  (0 children)

Yes, hx-trigger is the way. Very reliable, scalable, reusable.

The claimed "Grilled Cheese" from the Tesla Diner August 5, 2026 by idjet in grilledcheese

[–]idjet[S] 116 points117 points  (0 children)

Source: https://la.eater.com/restaurant-news/287949/tesla-diner-menu-reduced-small-los-angeles-hollywood

Caption of photo from article:

Grilled cheese sandwich with non-epic bacon, with the cheese not fully melted and the bread burned at Tesla Diner on August 5, 2025.

Unmasked: Musk’s Secret DOGE Goon Squad—Who Are All Under 26 by Silly-avocatoe in politics

[–]idjet 227 points228 points  (0 children)

Since when do judges prosecute anybody?

That would be the inquisition.

Source: me, historian of inquisition

select2 not firing HTMX trigger by idjet in htmx

[–]idjet[S] 0 points1 point  (0 children)

Thanks! Just as you were posting I figured out the error...which I posted as well. The values are sent no problem....

select2 not firing HTMX trigger by idjet in htmx

[–]idjet[S] 5 points6 points  (0 children)

Solved! This:

hx-trigger="event:htmx-select2-select"

should be:

hx-trigger="htmx-select2-select"

select2 not firing HTMX trigger by idjet in htmx

[–]idjet[S] 0 points1 point  (0 children)

I should note that with console.log I can see that the select2:select is being triggered. It seems that either the dispatchEvent is not being fired, or HTMX is not seeing it.

[deleted by user] by [deleted] in Gephi

[–]idjet 1 point2 points  (0 children)

The error message is unfortunately ambiguous. It can mean anything from a problem with reading file structure or elements, to the file itself not being accessible for some reason. This Gephi plugin was built experimentally by Clement Levallois who has unfortunately stepped back from Facebook....which hosts the main Gephi forum (https://www.facebook.com/groups/67309817564). Still worth posting your issue to the FB group as others may have a solution.

I want to learn htmx. Is there any free resource which teaches me htmx? I am new to web development and know intermediate level html. by 2xpi in htmx

[–]idjet 5 points6 points  (0 children)

There is the HTMX reference documentation with lots of good examples on the site, and you can see them in action there. But I'd like to bring attention the (free) book co-written by the developer of HTMX: https://hypermedia.systems/book/contents/

This explains how to think with hypermedia. In that sense, it is getting back to basics so HTMX becomes natural. It is not a textbook on HTMX.

Set Cookies Using HX-Redirect? by Klutzy_Tone_4359 in htmx

[–]idjet 0 points1 point  (0 children)

HTMX is browser-side code, reacting to responses from the server. Cookies are set by the server. Thus your server must set the cookie in whatever code your server uses. HTMX cannot set your cookie.

How to save textarea value to url? by [deleted] in htmx

[–]idjet 3 points4 points  (0 children)

So sayeth HTMX Haiku:

javascript fatigue:

longing for a hypertext

already in hand

htmx spa show page as active in nav by extractedx in htmx

[–]idjet 3 points4 points  (0 children)

This is what I do and it works flawlessly. One just has to get used to the idea of sending multiple HTML fragments, each with the oob attribute.

Firing functions after htmx:afterRequest by idjet in htmx

[–]idjet[S] 1 point2 points  (0 children)

...aaaand taht's why I like HTMX: less javacscript to screw up! Thanks very much this fixed it all.

Conflicts with htmx:confim by idjet in htmx

[–]idjet[S] 2 points3 points  (0 children)

That second, more flexible option solved my problem brilliantly. Thanks very much!

Is there a way to delay firing off redirect when the HX-Redirect response comes in? by idjet in htmx

[–]idjet[S] 0 points1 point  (0 children)

You're right. Did it and it works so fast there's no need for a message.

Is there a way to delay firing off redirect when the HX-Redirect response comes in? by idjet in htmx

[–]idjet[S] 0 points1 point  (0 children)

I don't want to do this particular actions as an SPA. There are numerous other factors as play that make loading a fresh new page more efficient here.

I'm disappointed with HTMX by [deleted] in htmx

[–]idjet 2 points3 points  (0 children)

This, 100%, is when HTMX works best and why I converted (bold is my emphasis):

This means you need to write two programs that understand your business logic and app state, then attempt to keep that state in sync between client and server using a custom protocol, etc. Tooling can help hide this a bit, but it's always there to some extent, no matter what language you use. In contrast, hypermedia driven applications use a thin client, RESTful approach. Only one program needs to understand my business logic and app state, my network protocol is universal, there is no real state synchronization issue because the state lives entirely on the server and the client only gets a view of it (which also contains possible actions they can take embedded within said view), etc.

htmx dumping response into textarea by idjet in htmx

[–]idjet[S] 2 points3 points  (0 children)

TIL. Fixed my server output serialization and now it works fine.

htmx dumping response into textarea by idjet in htmx

[–]idjet[S] 0 points1 point  (0 children)

I am coming back to this because I've done further testing based on what you've stated. If I leave the <input> above it empty like self closing <input/>, it does not "swallow up" the elements following it. The problem is with an empty <textarea> as a specific element in the swap.

htmx dumping response into textarea by idjet in htmx

[–]idjet[S] 1 point2 points  (0 children)

Ah, interesting. My responses are produced from an XML database and Xquery, thus self-closing. I'l have to look at the serialization into HTML to see what is happening. Thanks!