// Initialize variables
// Function to load more items
$('#loading').show(); // Show loading indicator
// AJAX request to load next page
currentPage), // Use nextlink or build URL with currentPage
$('#loading').hide(); // Hide loading indicator
$('#ajaxContent').append(response); // Append new content
$('#loading').hide(); // Hide loading indicator
// Function to construct the full URL with pagination and filters ...
// Function to handle filtering and AJAX content loading
nextlink = buildFullUrl(1); // Get initial URL with filters
// Perform AJAX request to load content based on filters
currentPage = 1; // Reset currentPage for pagination
endOfResults = false; // Reset endOfResults flag
$("#ajaxLoader").fadeOut(1000); // Hide loader after content is loaded
// Event listeners for dynamic attribute changes and filter button click
filter(); // Call filter function on attribute change or sort change
filter(); // Call filter function on filter button click
// Load more items when scrolling near bottom
// $(window).scroll(function() {
// if ($(window).scrollTop() >= $(document).height() - $(window).height() - 150) {
// loadMoreItems();
// }
// });
// Initial load of items