ajax传递数组,后台接收为null解决方法
生活随笔
收集整理的這篇文章主要介紹了
ajax传递数组,后台接收为null解决方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
traditional:true,加上這個就好,默認為false,即允許深度序列化參數,但是servlet api不支持,所有設為true阻止就好了。 $.ajax({
type:'post',
url:'/lst',
async:true,
data:{"arr_id":arr_id},
traditional:true,
success:function (message) {
alert(message)
},
error:function () {
alert('執行失敗');
}
});
type:'post',
url:'/lst',
async:true,
data:{"arr_id":arr_id},
traditional:true,
success:function (message) {
alert(message)
},
error:function () {
alert('執行失敗');
}
});
轉載于:https://www.cnblogs.com/-llf/p/10600390.html
總結
以上是生活随笔為你收集整理的ajax传递数组,后台接收为null解决方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 为什么操作dom会消耗性能
- 下一篇: Luogu P4168 [Violet]