Ticket #6616: is_ajax.2.diff
File is_ajax.2.diff, 1.2 KB (added by , 17 years ago) |
---|
-
django/http/__init__.py
79 79 80 80 def is_secure(self): 81 81 return os.environ.get("HTTPS") == "on" 82 83 def is_ajax(self): 84 return self.META.get('HTTP_X_REQUESTED_WITH') == 'XMLHttpRequest' 82 85 83 86 def _set_encoding(self, val): 84 87 """ -
docs/request_response.txt
189 189 Returns ``True`` if the request is secure; that is, if it was made with 190 190 HTTPS. 191 191 192 ``is_ajax()`` 193 **New in Django development version** 194 195 Returns ``True`` if the request was made via an XMLHttpRequest by checking 196 the 'HTTP_X_REQUESTED_WITH' header for the string 'XMLHttpRequest'. The 197 following major Javascript libraries send this header: 198 199 * jQuery 200 * Dojo 201 * MochiKit 202 * MooTools 203 * Prototype 204 * YUI 205 206 If you write your own XMLHttpRequest, you will have to set this header 207 manually to use this method. 208 192 209 QueryDict objects 193 210 ----------------- 194 211