diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-03-20 07:16:16 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-03-20 07:16:16 +0000 |
| commit | c0537a961fcf412ff284a838e4394fc537c14dcf (patch) | |
| tree | 1a6e0de27ea706a9161975e445f407d0ac1b3c59 /docs | |
| parent | c01e6b852ab652e9ba3f7d3ac43cd5d20802a215 (diff) | |
Fixed #6616 -- Added an is_ajax() method to HttpRequest that uses the de facto
standard header for detecting an XmlHttpRequest call. Thanks, Daniel Lindsley.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7334 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/request_response.txt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/request_response.txt b/docs/request_response.txt index 4dcdf10adf..0e0f046a2d 100644 --- a/docs/request_response.txt +++ b/docs/request_response.txt @@ -199,6 +199,23 @@ Methods Returns ``True`` if the request is secure; that is, if it was made with HTTPS. +``is_ajax()`` + **New in Django development version** + + Returns ``True`` if the request was made via an XMLHttpRequest by checking + the ``HTTP_X_REQUESTED_WITH`` header for the string *'XMLHttpRequest'*. The + following major Javascript libraries all send this header: + + * jQuery + * Dojo + * MochiKit + * MooTools + * Prototype + * YUI + + If you write your own XMLHttpRequest call (on the browser side), you will + have to set this header manually to use this method. + QueryDict objects ----------------- |
