我正在尝试使用jQuery函数构建产品过滤器,并向控制器发送Ajax请求以根据类别选择品牌和价格范围
$(function () { $("#slider-range").slider({ range: true, min: 100, max: 1000000, values: [100, 1000000], slide: function (event, ui) { $("#amount_start").val(ui.values[ 0 ]); $("#amount_end").val(ui.values[ 1 ]); var start = $('#amount_start').val(); var end = $('#amount_end').val(); $.ajax({ type: 'get', dataType: 'html', url: '', data: "start=" + start + "& end=" + end, success: function (response) { console.log(response); $('#updateDiv').html(response); } }); } }); $('.try').click(function(){ //alert('hardeep'); var brand = []; $('.try').each(function(){ if($(this).is(":checked")){ brand.push($(this).val()); } }); Finalbrand = brand.toString(); console.log(Finalbrand); $.ajax({ type: 'get', dataType: 'html', url: '', data: "brand=" + Finalbrand, success: function (response) { console.log(response); $('#updateDiv').html(response); } }); }); });