Spec-Zone.ru › htmx

htmx:after:history:update

Fires after browser history update

The htmx:after:history:update event fires after htmx has updated the browser history state.

When It Fires

After history.pushState() or history.replaceState() completes.

Event Detail

  • history - Object with type (“push” or “replace”) and path
  • sourceElement - Element that triggered the navigation
  • response - Response object

Example

htmx.on('htmx:after:history:update', (evt) => {
  console.log('History updated to:', evt.detail.history.path);
  // Update analytics, breadcrumbs, etc.
});

The URL bar now reflects the new path.

Licensed under the Zero-Clause BSD License.
https://four.htmx.org/reference/events/htmx-after-history-update/

Spec-Zone.ru

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