htmx/www/headers/hx-push.md
Ben Pate 8ac4f651b1
Response Header HX-Push:false (#734)
* Support header HX-Push="false"

This is a tiny change that allows the `HX-Push` response header to obey "false" just like the `hx-push-url` attribute.

* Add documentation for hx-push response header
2022-02-04 11:06:54 -07:00

981 B

layout title
layout.njk </> htmx - HX-Trigger Response Headers

HX-Push Response Header

The hx-push-url attribute allows you to "push" a new entry into the browser location bar, which creates a new history entry, allowing back-button and general history navigation. The possible values of this attribute are true, false or a custom string.

This response headers allows you to "push" a new entry into the browser location bar, similar to how the hx-push-url attribute works in htmx markup. This creates a new history entry, allowing back-button and general history navigation.

If present, this header value overrides the default behavior defined in htmx markup. For example: The possible values of this attribute are true, false or a custom string.

Possible values for this header are 1) any valid URL to be pushed into the location bar, or 2) the string false, which prevents the browser's history from being updated.