controller
@RequestMapping("/queryByBrandAndLocation")
public PagesUtil<Furniture> queryByBrandAndLocation(@RequestParam(value = "furnName", required = false) String furnName,
@RequestParam(value = "brands", required = false) List<String> brands,
页面
//jquery获取复选框值
var brands =[];//定义一个数组
$('input[name="brand"]:checked').each(function(){//遍历每一个名字为interest的复选框,其中选中的执行函数
brands.push($(this).val());//将选中的值添加到数组chk_value中
});
var locations =[];//定义一个数组
$('input[name="location"]:checked').each(function(){//遍历每一个名字为interest的复选框,其中选中的执行函数
locations.push($(this).val());//将选中的值添加到数组chk_value中
});
$("#zhineng").click(function () {
$.ajax({
url:"/queryByBrandAndLocation",
type:"get",
data:{brands:brands,locations:locations,"furnName":furnName,"typeId":typeId,"pageIndex":pageIndex},
dataType:"json",
success:function (data) {
。。。
}
});
});