gpt4 book ai didi

php - 在jquery分页中使用复选框过滤结果

转载 作者:行者123 更新时间:2023-12-01 04:17:10 25 4
gpt4 key购买 nike

$(document).ready(function(){

function loading_show(){
$('#loading').html("<img src='imagesnew/searching.GIF'/>").fadeIn('fast');
}

function loading_hide(){
$('#loading').fadeOut('fast');
}


function loadData(page){

loading_show();
$.ajax
({
type: "POST",
url: "results.php",
data: "page="+page+"&city="+city+"&checkin="+checkin+"&checkout="+checkout,

success: function(msg)
{
$("#ListingContainer").ajaxComplete(function(event, request, settings)
{
loading_hide();
$("#ListingContainer").html(msg);
});
}
});
}

loadData(1); // For first time page load default results

$('#ListingContainer .pagination li.active').live('click',function(){
var page = $(this).attr('p');

loadData(page);$('body,html').animate({scrollTop: 0}, 800);return false;

});

$('#go_btn').live('click',function(){
var page = parseInt($('.goto').val());
var no_of_pages = parseInt($('.total').attr('a'));
if(page != 0 && page <= no_of_pages){
loadData(page);
}else{
alert('Enter a PAGE between 1 and '+no_of_pages);
$('.goto').val("").focus();
return false;
}

});
});

分页工作完美。在左侧,我有复选框来过滤将查询发送到 results.php 文件的结果。我怎样才能实现过滤?请帮助我,因为我是新手

最佳答案

要通过选中/不选中的复选框进行过滤,您必须进行如下检查,

if ($('#selected').is(':checked')) {
//send the value in Ajax
} else {
//dont send the value Ajax
}

关于php - 在jquery分页中使用复选框过滤结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13951965/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com