Django

Code

Show
Ignore:
Timestamp:
03/20/08 02:16:16 (8 months ago)
Author:
mtredinnick
Message:

Fixed #6616 -- Added an is_ajax() method to HttpRequest that uses the de facto
standard header for detecting an XmlHttpRequest? call. Thanks, Daniel Lindsley.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/request_response.txt

    r7303 r7334  
    199199   Returns ``True`` if the request is secure; that is, if it was made with 
    200200   HTTPS. 
     201 
     202``is_ajax()`` 
     203   **New in Django development version** 
     204 
     205   Returns ``True`` if the request was made via an XMLHttpRequest by checking 
     206   the ``HTTP_X_REQUESTED_WITH`` header for the string *'XMLHttpRequest'*. The 
     207   following major Javascript libraries all send this header: 
     208 
     209   * jQuery 
     210   * Dojo 
     211   * MochiKit 
     212   * MooTools 
     213   * Prototype 
     214   * YUI 
     215 
     216   If you write your own XMLHttpRequest call (on the browser side), you will 
     217   have to set this header manually to use this method. 
    201218 
    202219QueryDict objects