mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-10-02 07:21:05 +00:00
25 lines
571 B
Markdown
25 lines
571 B
Markdown
---
|
|
layout: layout.njk
|
|
title: </> htmx - hx-error-url
|
|
---
|
|
|
|
## `hx-error-url`
|
|
|
|
The `hx-error-url` attribute allows you to send client-side errors to a specified URL. It is typically put on the
|
|
body tag, so all errors are caught and send to the server.
|
|
|
|
```html
|
|
<body hx-error-url="/errors">\
|
|
|
|
</body>
|
|
```
|
|
When a client side error is caught by htmx it will be `POST`-ed to the given URL, with the following JSON format:
|
|
|
|
```json
|
|
{ "elt": elt.id, "event": eventName, "detail" : detail }
|
|
```
|
|
|
|
### Notes
|
|
|
|
* `hx-error-url` is inherited and can be placed on a parent element
|