question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Specify multiple targets to swap

See original GitHub issue

This is a related note to this: https://github.com/bigskysoftware/htmx/issues/26

And I appreciate possibly a hard ask, but…

I understand how the oob feature lets me return multiple containers that can get injected into the page, but this requires architecting my app such that it only returns fragments in response to an htmx request. However I would prefer to always send a single, full-page HTML response, and leave it to the front-end to pick and choose what to inject or discard.

For example if I’m building a store, and I want a user to be able to add an item to their cart, there are at least 2 DIVs in the response that I’d like to select & inject; a flash/notice confirming the add, and an update to the cart icon along my navigation bar.

I’m curious to hear your thoughts on this scenario. Thanks!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:6
  • Comments:21 (12 by maintainers)

github_iconTop GitHub Comments

5reactions
sandebertcommented, Apr 12, 2021

Any progress on this…?

4reactions
Miguel-Serejocommented, Sep 25, 2020

The whole point of htmx is so we can write less javascript.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can hx-select-oob update several targets? - Stack Overflow
If your goal is to return html content and copy the same content to multiple targets - you simply use class selector instead...
Read more >
Multiple Targets (GNU make)
When an explicit rule has multiple targets they can be treated in one of two possible ways: as independent targets or as grouped...
Read more >
Handling multiple targets using the tab switch
When we are dealing with multiple targets in Metasploit, we have to switch between sessions in order to manage them. This process of...
Read more >
make multiple targets - Unix & Linux Stack Exchange
The default target is the first target unless you don't specify it (depends on make-dialect). For example: # Makefile a b: echo a...
Read more >
GNU Make - Writing Rules - MIT
A rule with multiple targets is equivalent to writing many rules, each with one target, and all identical aside from that. The same...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found