I have a form that gets submitted using jQuery's .post().
In the corresponding view function, is there a way that I can use to determine that the requested received is AJAX?
I have seen code snippet dated back to 2006, which uses
request.GET.has_key('xhr')
But I don't see anything in my request.GET. I am guessing the above might be obsolete.
Please advise what I can do to achieve my purpose. Thanks.
request.is_ajax()
https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.is_ajax
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With