The named places where web-base touches htmx (SPEC §9). Every HX- literal in
the base lives in this file: the request classifier that decides fragment or
page, and the redirect response the gate answers with. The error renderer is
the third place and it calls partial-request? rather than reading headers.
Verified against htmx 4.0.0: HX-Request is sent on every htmx request, and
HX-Request-Type says full when the swap targets the whole document — a
history restore, a body-targeted swap — and partial otherwise. Deciding on
HX-Request alone would hand a bare fragment to the back button.
The named places where web-base touches htmx (SPEC §9). Every `HX-` literal in the base lives in this file: the request classifier that decides fragment or page, and the redirect response the gate answers with. The error renderer is the third place and it calls `partial-request?` rather than reading headers. Verified against htmx 4.0.0: `HX-Request` is sent on every htmx request, and `HX-Request-Type` says `full` when the swap targets the whole document — a history restore, a body-targeted swap — and `partial` otherwise. Deciding on `HX-Request` alone would hand a bare fragment to the back button.
The request headers htmx 4 sends for a swap, as Ring delivers them: what
a host's test sends to stand in for one. partial-request? answers true.
The request headers htmx 4 sends for a swap, as Ring delivers them: what a host's test sends to stand in for one. `partial-request?` answers true.
(partial-request? request)True when htmx asked for a fragment rather than a whole document. Ring lowercases request header names.
True when htmx asked for a fragment rather than a whole document. Ring lowercases request header names.
(redirect location)A response that makes htmx navigate the whole window to location. A 302
would be followed by htmx and its target swapped with the login page; and
HX-Location would do the same through an AJAX navigation. Only
HX-Redirect leaves the fragment's target alone.
A response that makes htmx navigate the whole window to `location`. A `302` would be followed by htmx and its target swapped with the login page; and `HX-Location` would do the same through an AJAX navigation. Only `HX-Redirect` leaves the fragment's target alone.
(refresh response)response asking htmx to reload the whole page. For a fragment that rotated the
session: the page it lands in still carries the old CSRF token in <body>'s
hx-headers, which only a full page can replace. htmx 4 reads it as
hx.refresh === "true" (measured in the bundled build).
`response` asking htmx to reload the whole page. For a fragment that rotated the session: the page it lands in still carries the old CSRF token in `<body>`'s `hx-headers`, which only a full page can replace. htmx 4 reads it as `hx.refresh === "true"` (measured in the bundled build).
Value of the Vary header for any response whose shape depends on the
request being an htmx fragment or a page, so a shared cache never serves a
fragment to a navigation.
Value of the `Vary` header for any response whose shape depends on the request being an htmx fragment or a page, so a shared cache never serves a fragment to a navigation.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |