Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8823337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:19:45+00:00 2026-06-14T06:19:45+00:00

I’m trying to make a paging functionality in a rss parser. It’s almost working.

  • 0

I’m trying to make a paging functionality in a rss parser. It’s almost working. Only the last page is wrong. See fiddle here. The last page displays 11-10. Why is that? There are currently 10 items in the feed, so in this example there should be only two pages, not three – and on page number two, the “next” button should be hidden.

Is this where something is wrong?

if (numEntriesReturned+1-oRssConfig.contempOffset>0 && oRssConfig.contempOffset<100-oRssConfig.maxItems) $('#btnNext').css("display", "block");
    else $('#btnNext').css("display", "none");
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T06:19:46+00:00Added an answer on June 14, 2026 at 6:19 am

    After many hours, I re-wrote the script completely. This should work to load & paginate the RSS feed using Zazar’s zRSSFeed plug-in. I commented most functions so you can see and understand whats going on, well, hopefully!

    Features:
    Easily choose ‘Feeds Per Page’ to display.
    Easily enter the link to the RSS Feed.
    Next & Previous Buttons appear/disappear when needed.
    Displays Feed Count automatically on each page. Example: ‘1 of 5’

    Check out this Fiddle to see it in action!
    Any questions?

    JQuery Script

    // Editable Values
    var feedlink = 'http://feeds.reuters.com/reuters/oddlyEnoughNews'; // Set Feed Location
    var fpp = 4; // Choose how many feeds per page to display (fpp = Feeds Per Page)
    var feedview = '#RSSview'; // Choose where to diplay the RSS Feed
    
    // Initial Variables ( Do Not Edit )
    var feeds = null; // Variable to hold total feed count
    var totalpages = null; // Variable to hold total pages
    var currentpage = null; // Variable to hold Current Page being Displayed
    var lastpagefeeds = null; // Variable to hold Amount of Feeds on the Last Page
    var firstof = null; // Variable to hold First Feed Display - Example: 3 of ?
    var lastof = null; // Variable to hold Last Feed Display - Example: ? of 10
    var feedoffset = 1; // Set Initial Feed Offset
    
    ///////////////////
    // RSS Functions //
    ///////////////////
    
    // Calulate Feed Count Display
    function displayfeedcount(){
        // Set 'First Of ???'
        firstof = feedoffset;
        // Set '??? of Last'
        if(currentpage == Math.ceil(totalpages)){ lastof = feeds; }else{ lastof = (firstof + fpp) - 1;}
        $('#offsetDispl').html( firstof + ' of ' + lastof); // Display Feed Count ' First of Last'
    }
    
    // Load Initial Feeds on Page 1
    function initialfeeds(){
        $(feedview).rssfeed( feedlink , { limit: fpp , offset: 0 }); // Load Initial Set of Feeds
        currentpage = 1; // Set Current Page to 1
        displayfeedcount(); // Trigger the Display of Feedcount - Example: '1 of 5'
    }
    
    // Calculate Total Pages
    function calculatepages(){
        totalpages = feeds / fpp; // Total Page Calculation
        console.log( 'Total Pages: ' + totalpages); // Log - For Testing Purposes Only - Delete if Desired
        initialfeeds(); // Trigger Initial Display of Feeds
    }
    
    // Determine if the NextBtn should be shown on load
    function showbuttons(){
        if ( feeds > fpp ){ $('#btnNext').show(); } // Evaluate 'Next Button' Visibility
    }
    
    // Determine Total Feed Count
    function feedcount() {
        feeds = arguments[1]; // Set Feed Count to Variable 'feeds'
        console.log( 'Total Feeds: ' + feeds ); // Log - For Testing Purposes Only - Delete if Desired
        showbuttons(); // Trigger Initial Button Display
        calculatepages(); // Trigger Total Page Calculation
    }
    
    // Function to Show Next Page
    function nextpage(){
        currentpage = currentpage + 1; // Set New Current Page
        feedoffset = feedoffset + fpp ; // Set New Feed Offset   
        console.log('Current Page is: ' + currentpage);  // Log - For Testing Purposes Only - Delete if Desired
        console.log('Feed Offset is: ' + feedoffset );  // Log - For Testing Purposes Only - Delete if Desired
        $(feedview).rssfeed( feedlink , { limit: fpp , offset: feedoffset }); // Load Next Set of Feeds
        if( currentpage >= totalpages ){ $('#btnNext').hide();} // Evaluate 'Next Button' Visibility
        if( currentpage > 1){ $('#btnPrev').fadeIn('250');} // Evaluate 'Previous Button' Visibility
        displayfeedcount(); // Display Feed Count ' ??? of ??? '   
    }
    
    // Function to Show Previous Page
    function prevpage(){
        currentpage = currentpage - 1;  // Set New Current Page
        feedoffset  = feedoffset - fpp ; // Set New Feed Offset
        console.log('Current Page is: ' + currentpage);  // Log - For Testing Purposes Only - Delete if Desired
        console.log('Feed Offset is: ' + feedoffset );  // Log - For Testing Purposes Only - Delete if Desired
        $(feedview).rssfeed( feedlink , { limit: fpp , offset: feedoffset });
        if( currentpage <= totalpages ){ $('#btnNext').fadeIn('250');} // Evaluate 'Next Button' Visibility
        if( currentpage <= 1){ $('#btnPrev').hide();} // Evaluate 'Previous Button' Visibility
        displayfeedcount(); // Display Feed Count ' ??? of ??? '
    }
    
    // Bind Previous and Next Button Clicks
    $('#btnPrev').on('click', prevpage); // Bind the PrevPage Function
    $('#btnNext').on('click', nextpage); // Bind the NextPage Function
    
    // Retrieve Total Feeds
    $('#hidden').rssfeed( feedlink , {}, feedcount);
    // Make sure this divider exists on the page body >>>  <div id="hidden" style='display:none;'></div>   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.