Spec-Zone.ru › htmx

HX-Location

Redirect without a full page load

The HX-Location response header redirects without reloading the page.

Syntax

Return a path:

HX-Location: /dashboard

HX-Location calls htmx.ajax(). The header above is equivalent to:

htmx.ajax('GET', '/dashboard', { push: 'true' })

Use any serializable htmx.ajax() option. Include path:

# HCON
HX-Location: path:/search target:#results select:#matches

# JSON
HX-Location: {"path":"/search","target":"#results","select":"#matches"}

Notes

HX-Location is not processed on 3xx responses. Return a 2xx response instead.

Licensed under the Zero-Clause BSD License.
https://four.htmx.org/reference/headers/HX-Location/

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API