var ids=[1,2,3]
$.ajax({
type: "POST",
url: '/xxx/',
data: {"id": ids,'csrfmiddlewaretoken': '{{ csrf_token }}'},
dataType: 'json',
cache: false,
traditional:true,
async: false,
success: function (result) {
}
})
//1、403错误
'csrfmiddlewaretoken': '{{ csrf_token }}'
//2、参数中传数组
traditional:true,
//3、在外部使用ajax返回的结果
async: false,
//替换字符串中指定字符
roleUStr=roleUStr.replace(/'/g,"")
roleUStr=roleUStr.replace(/\[/g,"")
roleUStr=roleUStr.replace(/\]/g,"")