ajax解决传递数组的问题
程序员文章站
2023-11-11 08:12:10
ajax解决传递数组的问题
$.ajax({
type: "post",
url: "../station/refreshguninfo&quo...
ajax解决传递数组的问题
$.ajax({ type: "post", url: "../station/refreshguninfo", data: {gunlists:gunnuma}, traditional: true, //解决传递数组的问题 async: false, datatype: 'json', success: function(result){ if(result.status == 'success'){ gunlist=result.data; } } });
后端代码:
@requestmapping("refreshguninfo") @responsebody public listrefreshguninfo(string[] gunlists) { if(gunlists == null || gunlists.length == 0){ return new arraylist<>(); } }
上一篇: 实战301永久重定向经验谈
下一篇: 企业为什么应该做网站优化推广