ajax分页
$("button").click( function(){ var csrfToken = $("[name='csrfmiddlewaretoken']").val() var more_id = this.id console.log(more_id) $.ajax({ url:'/detail_type/', data:{'id_':more_id,'csrfmiddlewaretoken':csrfToken}, type:'post', success:function(resp){ var params = JSON.parse(resp) console.log(params) var str = '' for (let index = 0; index < params.length; index++) { str += '<li>'+ params[index]['fields']['name']+'</li>'; } $("#content").html(str) } }) } )
data = serializers.serialize('json',detail_type,ensure_ascii=False)