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)

 

posted @ 2019-04-24 19:50  嘿嘿嘿!!  阅读(74)  评论(0编辑  收藏  举报