htmx 4.0 is under construction — migration guide

htmx.config.noSwap

HTTP status codes that skip swap

The htmx.config.noSwap option is an array of HTTP status codes for which htmx will not perform a content swap.

Default: [204, 304]

Example

htmx.config.noSwap = [204, 304, 205];
<meta name="htmx-config" content='{"noSwap":[204,304,205]}'>

Responses with these status codes will trigger events but won’t swap content.