htmx/www/extensions/ajax-header.md
Denis Palashevskii a708395d46 Docs: Move extension script URL to the start of the page (#1232)
* Move extension script URL to the start of the page

* Improve visibility of installation instructions on /extensions page
2023-02-02 16:59:03 -07:00

469 B

layout title
layout.njk </> htmx - high power tools for html

The ajax-header Extension

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

<script src="https://unpkg.com/htmx.org/dist/ext/ajax-header.js">

Usage

<body hx-ext="ajax-header">
 ...
</body>