Django request.is_ajax returning false

前端 未结 6 1945
清歌不尽
清歌不尽 2020-12-09 09:12

I am testing out ajax with Django + jQuery. I have this in my views:

def ajax_test(request):
    if request.is_ajax():
        message = \"This is ajax\"
            


        
6条回答
  •  既然无缘
    2020-12-09 09:40

    Try with other version of jQuery... it possible that the problem was in the js...

    For example:

    http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js

提交回复
热议问题