mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-10-02 07:21:05 +00:00
22 lines
403 B
Markdown
22 lines
403 B
Markdown
+++
|
|
title = "ajax-header"
|
|
+++
|
|
|
|
This extension adds the `X-Requested-With` header to requests with the value "XMLHttpRequest".
|
|
|
|
This header is commonly used by javascript frameworks to differentiate ajax requests from normal http requests.
|
|
|
|
## Install
|
|
|
|
```html
|
|
<script src="https://unpkg.com/htmx.org/dist/ext/ajax-header.js"></script>
|
|
```
|
|
|
|
## Usage
|
|
|
|
```html
|
|
<body hx-ext="ajax-header">
|
|
...
|
|
</body>
|
|
```
|