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.
https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.is_ajax