diff options
author | Carson Gross <carson@bigsky.software> | 2025-06-02 11:51:28 -0600 |
---|---|---|
committer | Carson Gross <carson@bigsky.software> | 2025-06-02 11:51:28 -0600 |
commit | d1d0cd916b74b99001f020da24603cf04d1ea0d9 (patch) | |
tree | e57017afc757a53aeccbc8ee6e6223bd674297b9 /www/content | |
parent | dd1914d503ad4e29652bdc886c4fe5844c65dfa7 (diff) | |
parent | 11ff1940f0444c34c1b626b2369e90b36d0406a2 (diff) | |
download | htmx-master.tar.gz htmx-master.zip |
Diffstat (limited to 'www/content')
-rw-r--r-- | www/content/attributes/hx-disable.md | 2 | ||||
-rw-r--r-- | www/content/events.md | 5 | ||||
-rw-r--r-- | www/content/examples/bulk-update.md | 2 | ||||
-rw-r--r-- | www/content/examples/confirm.md | 6 | ||||
-rw-r--r-- | www/content/examples/edit-row.md | 4 | ||||
-rw-r--r-- | www/content/extensions/_index.md | 2 | ||||
-rw-r--r-- | www/content/extensions/sse.md | 2 | ||||
-rw-r--r-- | www/content/server-examples.md | 5 |
8 files changed, 18 insertions, 10 deletions
diff --git a/www/content/attributes/hx-disable.md b/www/content/attributes/hx-disable.md index cccc4afa..a88ba73a 100644 --- a/www/content/attributes/hx-disable.md +++ b/www/content/attributes/hx-disable.md @@ -8,7 +8,7 @@ useful as a backup for HTML escaping, when you include user generated content in prevent malicious scripting attacks. The value of the tag is ignored, and it cannot be reversed by any content beneath it. - + ## Notes * `hx-disable` is inherited diff --git a/www/content/events.md b/www/content/events.md index fa0d26b5..42bd8eba 100644 --- a/www/content/events.md +++ b/www/content/events.md @@ -111,6 +111,7 @@ This event is triggered before an AJAX request is issued. If you call `preventD * `detail.elt` - the element that dispatched the request * `detail.xhr` - the `XMLHttpRequest` * `detail.target` - the target of the request +* `detail.boosted` - true if the request is via an element using boosting * `detail.requestConfig` - the configuration of the AJAX request ### Event - `htmx:beforeSend` {#htmx:beforeSend} @@ -137,6 +138,7 @@ See the documentation on [configuring swapping](@/docs.md#modifying_swapping_beh * `detail.elt` - the target of the swap * `detail.xhr` - the `XMLHttpRequest` +* `detail.boosted` - true if the request is via an element using boosting * `detail.requestConfig` - the configuration of the AJAX request * `detail.requestConfig.elt` - the element that dispatched the request * `detail.shouldSwap` - if the content will be swapped (defaults to `false` for non-200 response codes) @@ -157,6 +159,7 @@ happen instead. * `detail.elt` - the element that dispatched the request * `detail.xhr` - the `XMLHttpRequest` +* `detail.boosted` - true if the request is via an element using boosting * `detail.requestConfig` - the configuration of the AJAX request * `detail.shouldSwap` - if the content will be swapped (defaults to `false` for non-200 response codes) * `detail.target` - the target of the swap @@ -307,7 +310,7 @@ This event is triggered before the content is saved in the history api. ### Event - `htmx:load` {#htmx:load} -This event is triggered when a new node is loaded into the DOM by htmx. +This event is triggered when a new node is loaded into the DOM by htmx. Note that this event is also triggered when htmx is first initialized, with the document body as the target. ##### Details diff --git a/www/content/examples/bulk-update.md b/www/content/examples/bulk-update.md index 5a503e82..ea8cae73 100644 --- a/www/content/examples/bulk-update.md +++ b/www/content/examples/bulk-update.md @@ -30,7 +30,7 @@ values in the form submission (`POST` request): </tbody> </table> <input type="submit" value="Bulk Update" class="btn primary"> - <span id="toast"></span> + <output id="toast"></output> </form> ``` diff --git a/www/content/examples/confirm.md b/www/content/examples/confirm.md index 42f70031..5b3a272a 100644 --- a/www/content/examples/confirm.md +++ b/www/content/examples/confirm.md @@ -37,9 +37,9 @@ which is then picked up by `hx-trigger`. <script> document.addEventListener("htmx:confirm", function(e) { // The event is triggered on every trigger for a request, so we need to check if the element - // that triggered the request has a hx-confirm attribute, if not we can return early and let - // the default behavior happen - if (!e.detail.elt.hasAttribute('hx-confirm')) return + // that triggered the request has a confirm question set via the hx-confirm attribute, + // if not we can return early and let the default behavior happen + if (!e.detail.question) return // This will prevent the request from being issued to later manually issue it e.preventDefault() diff --git a/www/content/examples/edit-row.md b/www/content/examples/edit-row.md index 6ad724aa..e0dbb8d2 100644 --- a/www/content/examples/edit-row.md +++ b/www/content/examples/edit-row.md @@ -71,7 +71,7 @@ Finally, here is what the row looks like when the data is being edited: ```html <tr hx-trigger='cancel' class='editing' hx-get="/contact/${contact.id}"> - <td><input name='name' value='${contact.name}'></td> + <td><input autofocus name='name' value='${contact.name}'></td> <td><input name='email' value='${contact.email}'></td> <td> <button class="btn danger" hx-get="/contact/${contact.id}"> @@ -183,7 +183,7 @@ this makes things a bit nicer to deal with. function editTemplate(contact) { return `<tr hx-trigger='cancel' class='editing' hx-get="/contact/${contact.id}"> - <td><input name='name' value='${contact.name}'</td> + <td><input autofocus name='name' value='${contact.name}'</td> <td><input name='email' value='${contact.email}'</td> <td> <button class="btn danger" hx-get="/contact/${contact.id}"> diff --git a/www/content/extensions/_index.md b/www/content/extensions/_index.md index ed3bd3ba..2b5ae63e 100644 --- a/www/content/extensions/_index.md +++ b/www/content/extensions/_index.md @@ -123,7 +123,7 @@ htmx extensions are split into two categories: <td>{% markdown() %} The `safe-nonce` extension can be used to improve the security of the application/web-site and help avoid XSS issues by allowing you to return known trusted inline scripts safely {% end %}</td> </tr> <tr> - <td>{% markdown() %} [hx-drag](https://github.com/AjaniBilby/htmx-drag-examples/blob/main/readme.md) {% end %}</td> + <td>{% markdown() %} [hx-drag](https://www.npmjs.com/package/hx-drag) {% end %}</td> <td>{% markdown() %} This extension allows htmx requests to be sent for drag drop {% end %}</td> </tr> <tr> diff --git a/www/content/extensions/sse.md b/www/content/extensions/sse.md index 12e36a3f..d9e469da 100644 --- a/www/content/extensions/sse.md +++ b/www/content/extensions/sse.md @@ -30,7 +30,7 @@ The fastest way to install `sse` is to load it via a CDN. Remember to always inc ```HTML <head> <script src="https://unpkg.com/htmx.org@2.0.4" integrity="sha384-HGfztofotfshcF7+8n44JQL2oJmowVChPTg48S+jvZoztPfvwD79OC/LTtG6dMp+" crossorigin="anonymous"></script> - <script src="https://unpkg.com/htmx-ext-sse@2.2.2" integrity="sha384-Y4gc0CK6Kg+hmulDc6rZPJu0tqvk7EWlih0Oh+2OkAi1ZDlCbBDCQEE2uVk472Ky" crossorigin="anonymous"></script> + <script src="https://unpkg.com/htmx-ext-sse@2.2.3" integrity="sha384-Y4gc0CK6Kg+hmulDc6rZPJu0tqvk7EWlih0Oh+2OkAi1ZDlCbBDCQEE2uVk472Ky" crossorigin="anonymous"></script> </head> <body hx-ext="sse"> ``` diff --git a/www/content/server-examples.md b/www/content/server-examples.md index 2eea042e..2821818a 100644 --- a/www/content/server-examples.md +++ b/www/content/server-examples.md @@ -63,6 +63,11 @@ These examples may make it a bit easier to get started using htmx with your plat ## Java +### Javalin + +- <https://github.com/AussieGuy0/java-htmx-todo/> +- <https://github.com/erwindrsno/simple-to-do-list> + ### Spring Boot - <https://github.com/wiverson/htmx-demo> |