mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-29 05:51:39 +00:00
Copyediting in docs related to HTTP method attributes.
This commit is contained in:
parent
fd6e3f68d8
commit
eba776bbaf
@ -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
|
||||
* 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
|
||||
|
@ -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
|
||||
* 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
|
||||
|
@ -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
|
||||
* 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
|
||||
|
@ -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
|
||||
* 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
|
||||
|
@ -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
|
||||
* 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
|
||||
|
@ -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
|
||||
* The default settle delay is 100ms
|
||||
|
14
www/docs.md
14
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>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user