作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
$(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/
我是一名优秀的程序员,十分优秀!