Thanks to Kieth for posting an ajax solution. I just wanted to expand on it a little bit to figure out when we are at the end of the entries etc so we can hide loading more buttons etc. Here is what I did.
In my example I am only loading 2 entries for each click so I'm setting the count to 2, and then incrementing the count on each click by 2.
Here I am getting the total count for the entries above and putting this in a hidden input field inside my main container for the ajax section. Don't mind the .id('and, not '~featuredArticleIdsString) as I am just getting featured entries above this and then getting those id's so I can exclude them from the ajax section as I don't want to duplicate those entries.
{% set category = craft.categories.group('resource') %}
{% set featuredArticleIds = craft.entries.relatedTo(category).limit(3).ids() %}
{% set featuredArticleIdsString = featuredArticleIds | join(', not ') %}
{% set totalEntries = craft.entries.relatedTo(category).id('and, not '~featuredArticleIdsString).find() %}
{% set totalCount = totalEntries | length %}
<!-- Ajax Container Start -->
<div class="container-fluid add-top resources">
<!-- Set the total count of entries we will have access to in this section-->
<input id="totalResourceCount" type="hidden" value="{{totalCount}}">
Then here is the ajax section...
{% set pagingJs %}
$(function () {
var page = 2;
// Since we are getting two entries per click we need to set count to 2 to start
var count = 2
// Get the total count that we set above
var totalCount = $("#totalResourceCount").val();
$('#loadMore').click (function (e) {
e.preventDefault();
// Check if count is less than totalCount
if(count < totalCount){
$('#loading').show();
$.get( "/resource-ajax/p"+page, function( data ) {
$( "#featuredResults" ).prepend( data ).fadeIn("slow");
$('#loading').hide();
page++;
// Increment count by 2 entries
count = (count) + 2;
// Check if count is greater than or equal to the total count. If so hide the load more button. We need to check if count is greater than since we are incrementing an even number in case are total count is an odd. For example if we have total of 5 entries the second click would set the count to 6...
if(count >= totalCount){
$("#loadMore").hide();
}
});
}
});
});
{% endset %}
{% includeJs pagingJs %}