初めてdjangoでajaxを使用しています..ネットでいくつかのチュートリアルを読んで、ajaxを介していくつかの情報を投稿する簡単なフォームを作成しようとしています。
ここに私のhtmlフォームがあります
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
function send_request()
{
$.ajax({
type:"POST",
url:"/ajaxredirect/",
});
}
</script>
<button type="button" onclick="send_request();">change content</button>
そしてそれは私の見解です
def Ajaxquery(request):
if request.is_ajax():
return HttpResponse("ok")
else:
return HttpResponse("error")
ブラウザでコンテンツの変更ボタンをクリックしても何もしません。
どんな提案も歓迎されます