diff --git a/www/content/events.md b/www/content/events.md index ebcc3309d..d188fa8f9 100644 --- a/www/content/events.md +++ b/www/content/events.md @@ -48,10 +48,14 @@ can be paired with [`htmx:beforeRequest`](#htmx:beforeRequest) to wrap behavior * `detail.xhr` - the `XMLHttpRequest` * `detail.target` - the target of the request * `detail.requestConfig` - the configuration of the AJAX request -* `detail.successful` - true if the response has a 20x status code or is marked `detail.isError = false` in the - `htmx:beforeSwap` event, else false -* `detail.failed` - true if the response does not have a 20x status code or is marked `detail.isError = true` in the - `htmx:beforeSwap` event, else false +* `detail.successful` - true if the response is not marked as an error by the matched + [`htmx.config.responseHandling`](@/docs.md#response-handling) rule (by default, a 20x status code) or is marked + `detail.isError = false` in the `htmx:beforeSwap` event, else false. Note that if you customize + `responseHandling` to allow non-2xx codes to swap (e.g. `{"code":"...", "swap": true}` without `error: true`), + those responses will also be marked `successful` here. +* `detail.failed` - true if the response is marked as an error by the matched + [`htmx.config.responseHandling`](@/docs.md#response-handling) rule (by default, a non-20x status code) or is marked + `detail.isError = true` in the `htmx:beforeSwap` event, else false ### Event - `htmx:afterSettle` {#htmx:afterSettle}