diff options
author | carson <carson@leaddyno.com> | 2020-05-16 06:54:39 -0700 |
---|---|---|
committer | carson <carson@leaddyno.com> | 2020-05-16 06:54:39 -0700 |
commit | d4b4d462ab577a8e481e07e540bb3bc4343476c6 (patch) | |
tree | 97064b52d2b15b7615bdd4eada35471a40fc1207 | |
parent | 390ac2443b44d17f0fa17c71ee7653419fd69f65 (diff) | |
parent | d1e1aacb35503ece20cc8ee615cf3e882979ac35 (diff) | |
download | htmx-d4b4d462ab577a8e481e07e540bb3bc4343476c6.tar.gz htmx-d4b4d462ab577a8e481e07e540bb3bc4343476c6.zip |
Merge remote-tracking branch 'origin/dev' into dev
-rw-r--r-- | www/attributes/kt-delete.md | 4 | ||||
-rw-r--r-- | www/attributes/kt-get.md | 4 | ||||
-rw-r--r-- | www/attributes/kt-patch.md | 8 | ||||
-rw-r--r-- | www/attributes/kt-post.md | 4 | ||||
-rw-r--r-- | www/attributes/kt-put.md | 8 | ||||
-rw-r--r-- | www/attributes/kt-swap.md | 8 | ||||
-rw-r--r-- | www/docs.md | 14 |
7 files changed, 27 insertions, 23 deletions
diff --git a/www/attributes/kt-delete.md b/www/attributes/kt-delete.md index d3a863b2..a41a05a6 100644 --- a/www/attributes/kt-delete.md +++ b/www/attributes/kt-delete.md @@ -23,5 +23,5 @@ This example will cause the `button` to issue a `DELETE` to `/account` and swap * Since most browsers do not support issuing an actual `DELETE`, the request will actually be issued as a `POST`, with the [`X-HTTP-Method-Override`](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields) header set to `DELETE`. * You can control the target of the swap using the [kt-target](/attributes/kt-target) attribute -* You can control the swap strategy by using the [kt-swa](/attributes/kt-swap) attribute -* You can control what event triggers the request with the [kt-trigger](/attributes/kt-trigger) attribute
\ No newline at end of file +* You can control the swap strategy by using the [kt-swap](/attributes/kt-swap) attribute +* You can control what event triggers the request with the [kt-trigger](/attributes/kt-trigger) attribute diff --git a/www/attributes/kt-get.md b/www/attributes/kt-get.md index a44edac4..e2f5c65c 100644 --- a/www/attributes/kt-get.md +++ b/www/attributes/kt-get.md @@ -21,5 +21,5 @@ This example will cause the `div` to issue a `GET` to `/example` and swap the re * By default `kt-get` does not include any parameters. You can use the [kt-params](/attributes/kt-params) attribute to change this * You can control the target of the swap using the [kt-target](/attributes/kt-target) attribute -* You can control the swap strategy by using the [kt-swa](/attributes/kt-swap) attribute -* You can control what event triggers the request with the [kt-trigger](/attributes/kt-trigger) attribute
\ No newline at end of file +* You can control the swap strategy by using the [kt-swap](/attributes/kt-swap) attribute +* You can control what event triggers the request with the [kt-trigger](/attributes/kt-trigger) attribute diff --git a/www/attributes/kt-patch.md b/www/attributes/kt-patch.md index cb8874d1..7f59ddc1 100644 --- a/www/attributes/kt-patch.md +++ b/www/attributes/kt-patch.md @@ -5,7 +5,7 @@ title: </> kutty - kt-patch ## `kt-patch` -The `kt-patch` attribute will cause an element to issue a `DELETE` to the specified URL and swap +The `kt-patch` attribute will cause an element to issue a `PATCH` to the specified URL and swap the HTML into the DOM using a swap strategy: ```html @@ -21,7 +21,7 @@ This example will cause the `button` to issue a `PATCH` to `/account` and swap t * `kt-patch` is not inherited * Since most browsers do not support issuing an actual `PATCH`, the request will actually be issued - as a `POST`, with the [`X-HTTP-Method-Override`](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields) header set to `DELETE`. + as a `POST`, with the [`X-HTTP-Method-Override`](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields) header set to `PATCH`. * You can control the target of the swap using the [kt-target](/attributes/kt-target) attribute -* You can control the swap strategy by using the [kt-swa](/attributes/kt-swap) attribute -* You can control what event triggers the request with the [kt-trigger](/attributes/kt-trigger) attribute
\ No newline at end of file +* You can control the swap strategy by using the [kt-swap](/attributes/kt-swap) attribute +* You can control what event triggers the request with the [kt-trigger](/attributes/kt-trigger) attribute diff --git a/www/attributes/kt-post.md b/www/attributes/kt-post.md index 83c5f816..6a4d06ef 100644 --- a/www/attributes/kt-post.md +++ b/www/attributes/kt-post.md @@ -21,5 +21,5 @@ This example will cause the `button` to issue a `POST` to `/account/enable` and * `kt-post` is not inherited * You can control the target of the swap using the [kt-target](/attributes/kt-target) attribute -* You can control the swap strategy by using the [kt-swa](/attributes/kt-swap) attribute -* You can control what event triggers the request with the [kt-trigger](/attributes/kt-trigger) attribute
\ No newline at end of file +* You can control the swap strategy by using the [kt-swap](/attributes/kt-swap) attribute +* You can control what event triggers the request with the [kt-trigger](/attributes/kt-trigger) attribute diff --git a/www/attributes/kt-put.md b/www/attributes/kt-put.md index 2dd68b08..6aa310f4 100644 --- a/www/attributes/kt-put.md +++ b/www/attributes/kt-put.md @@ -5,7 +5,7 @@ title: </> kutty - kt-put ## `kt-put` -The `kt-put` attribute will cause an element to issue a `DELETE` to the specified URL and swap +The `kt-put` attribute will cause an element to issue a `PUT` to the specified URL and swap the HTML into the DOM using a swap strategy: ```html @@ -21,7 +21,7 @@ This example will cause the `button` to issue a `PUT` to `/account` and swap the * `kt-put` is not inherited * Since most browsers do not support issuing an actual `PUT`, the request will actually be issued - as a `POST`, with the [`X-HTTP-Method-Override`](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields) header set to `DELETE`. + as a `POST`, with the [`X-HTTP-Method-Override`](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields) header set to `PUT`. * You can control the target of the swap using the [kt-target](/attributes/kt-target) attribute -* You can control the swap strategy by using the [kt-swa](/attributes/kt-swap) attribute -* You can control what event triggers the request with the [kt-trigger](/attributes/kt-trigger) attribute
\ No newline at end of file +* You can control the swap strategy by using the [kt-swap](/attributes/kt-swap) attribute +* You can control what event triggers the request with the [kt-trigger](/attributes/kt-trigger) attribute diff --git a/www/attributes/kt-swap.md b/www/attributes/kt-swap.md index 49e6e1e6..577742f2 100644 --- a/www/attributes/kt-swap.md +++ b/www/attributes/kt-swap.md @@ -13,9 +13,9 @@ The possible values of this attribute are: * `innerHTML` - The default, replace the inner html of the target element * `outerHTML` - Replace the entire target element with the response * `beforebegin` - Insert the response before the target element -* `afterdegin` - Insert the response before the first child target element -* `beforeend` - Insert the response after the last child of target element -* `afterend` - Insert the response after target element +* `afterbegin` - Insert the response before the first child of the target element +* `beforeend` - Insert the response after the last child of the target element +* `afterend` - Insert the response after the target element These options are based on standard DOM naming and the [`Element.insertAdjacentHTML`](https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentHTML) @@ -52,4 +52,4 @@ These attributes can be used to synchronize kutty with the timing of CSS transit * `kt-swap` is inherited and can be placed on a parent element * The default value of this attribute is `innerHTML` * The default swap delay is 0ms -* The default settle delay is 100ms
\ No newline at end of file +* The default settle delay is 100ms diff --git a/www/docs.md b/www/docs.md index b985a13b..33e845a3 100644 --- a/www/docs.md +++ b/www/docs.md @@ -67,7 +67,7 @@ This tells kutty: Kutty extends and generalizes the core idea of HTML as a hypertext, opening up many more possibilities directly within the language: -* Now any element, not just anchors and forms, can issue a HTTP request +* Now any element, not just anchors and forms, can issue an HTTP request * Now any event, not just clicks or form submissions, can trigger requests * Now any [HTTP verb](https://en.wikipedia.org/wiki/HTTP_Verbs), not just `GET` and `POST`, can be used * Now any element, not just the entire window, can be the target for update by the request @@ -100,9 +100,12 @@ The core feature of kutty is a set of attributes that allow you to issue AJAX re * [kt-get](/attributes/kt-get) - Issues a `GET` request to the given URL * [kt-post](/attributes/kt-post) - Issues a `POST` request to the given URL -* [kt-put](/attributes/kt-put) - Issues a `PUT` request to the given URL (see [details](#kutty-request-details)) -* [kt-patch](/attributes/kt-patch) - Issues a `PATCH` request to the given URL (see [details](#kutty-request-details)) -* [kt-delete](/attributes/kt-delete) - Issues a `GET` request to the given URL (see [details](#kutty-request-details)) +* [kt-put](/attributes/kt-put) - Issues a `PUT` request to the given URL +* [kt-patch](/attributes/kt-patch) - Issues a `PATCH` request to the given URL +* [kt-delete](/attributes/kt-delete) - Issues a `DELETE` request to the given URL + +(Since most browsers only support issuing `GET` and `POST`, a request with one of the other three methods will +actually be issued as a `POST`, with the `X-HTTP-Method-Override` header set to the desired method.) Each of these attributes takes a URL to issue an AJAX request to. The element will issue a request of the specified type to the given URL when the element is [triggered](#triggers): @@ -406,6 +409,7 @@ kutty includes a number of useful headers in requests: * `X-KT-Active-Element` - the id of the current active element * `X-KT-Active-Element-Name` - the name of the current active element * `X-KT-Active-Element-Value` - the value of the current active element +* `X-HTTP-Method-Override` - the HTTP verb for non-`GET` and `POST` requests ### <a name="response-header"></a> [Response Headers](#response-headers) @@ -541,4 +545,4 @@ You can set them directly in javascript, or you can use a `meta` tag: And that's it! Have fun with kutty: you can accomplish [quite a bit](/examples) without a lot of code. </div> -</div>
\ No newline at end of file +</div> |