Skip to content

Commit

Permalink
Update advanced.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
idlesign committed Jan 10, 2023
1 parent cbebf23 commit 6858ef1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/source/advanced.rst
Expand Up @@ -9,21 +9,21 @@ Additional info from the client
to additional information received from the client:

* ``ajax.is_used`` - a flag indicating whether the request is Ajax or not
* ``ajax.restore_history`` - indicates the client side request to get the entire page
* ``ajax.restore_history`` - indicates the client side is requesting the entire page
(as opposed to a page fragment request), when the client was unable to restore a browser history state
from the cache.
* ``ajax.url`` - URL of the browser
* ``ajax.url`` - URL from the browser
* ``ajax.target`` - the id of the target element if it exists
* ``ajax.user_input`` - the user input to a prompt (hx-prompt)
* ``ajax.source`` - info about an element sourcing (triggering) the request (``id`` and ``name`` if any)
* ``ajax.user_input`` - user input given to a prompt (hx-prompt)
* ``ajax.source`` - info about an element sourcing (triggered) the request (``id`` and ``name`` if any)


.. note:: The object is lazily initialized to allow faster
middleware processing.

Without initialization you won't be able to access it's attributes.

For initialization it's enough to check it in boolean context, e.g.::
For the initialization it's enough to check it in boolean context, e.g.::

bool(Ajax(request))

Expand Down Expand Up @@ -83,7 +83,7 @@ Include htmx from CDN
~~~~~~~~~~~~~~~~~~~~~

You can make use of including ``siteajax/cdn.html`` in your template (page's ``head``)
to get ``htmx`` right from CDN.
to get ``htmx`` right from a CDN.

.. code-block:: html

Expand Down

0 comments on commit 6858ef1

Please sign in to comment.