TheOldDriver
8/23/2017 - 1:16 AM

ajax发送数组

ajax发送数组

$.ajax({
    type : "POST",
    data : {"select":select},
    traditional: true,
    url : "<c:url value='/completitionPaper/creatCompetitonPaper'/>",
    dataType : 'json',
    }
   });
   
//其中,select为数组类型,traditional: true这个设置很重要,
//contentType : "application/json; charset=utf-8",这个配置如果是传递数组是,不能这么配置,可不配置改属性,后台接受使用string[] select这个变量