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

  • SEARCH
  • Home
  • 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 9167345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:22:05+00:00 2026-06-17T15:22:05+00:00

Am parsing XML data with AJAX success method , And placing in table with

  • 0

Am parsing XML data with AJAX success method , And placing in table with LOAD MORE data option , when user clicks on LOAD MORE button ,first time it get add next N items ,when user click on second time the same items getting added to list .

Below is my code ,

function populateItems(position,page_size) {
    var url = "path_to_XML";
$.ajax({
type: "GET",
url: url,
dataType: "xml",
success: function(xml) {
  var title, url, block_count;
  var xmlDOM = $(xml);
  block_count = $(xml).find('item').length;
  xmlDOM.find("item").slice(position,position+page_size).each(function(){
            var $this=$(this);
            var $user=$this.find("user").text();
            var $fname=$this.find("fname").text();
            var $lname=$this.find("lname").text();
            var $sex=$this.find("sex").text();
            var $time=$this.find("time").text();
            $("#datatable").append("<tbody><tr class='datarow'><td>"+$time+"</td><td>"+$user+"</td><td>"+$fname+"</td><td>"+$lname+"</td><td>"+$url+"</td></tr><tbody>");
  });
                    $('#ajax-loader').hide();
}
});
}

 $(document).ready(function() {
    var position;var page_size;
    populateItems(0,40);
            $('#append2').click(function(position){
                    $('#log_hourly').show();
                    $items = populateItems(40,40);
                    $("#content").append($items);
                    $('#ajax-loader').hide();
            });

How can keep adding next N items when user click on LOAD MORE button

Please Help..

  • 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-17T15:22:06+00:00Added an answer on June 17, 2026 at 3:22 pm

    As I answered here you need to create a variable that counts which page are you showing or want to load, just that in your case you need to increase it by 40 each time:

    $(document).ready(function() {
        var page = 0;
        var position;var page_size;
        populateItems(page ,40);
        $('#append2').click(function(position){
            $('#log_hourly').show();
            page = page + 40;
            $items = populateItems(page ,40);
            $("#content").append($items);
            $('#ajax-loader').hide();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I am grabbing this XML data, and parsing it within the success function
Possible Duplicate: Parsing XML data to NSMutableArray iOS - iPhone <ForecastResult> <Forecast> <Date>2012-06-27T00:00:00</Date> <WeatherID>4</WeatherID>
I am working on a javascript project which involves parsing xml data. I have
In my application, I am parsing XML data using SAX Parser. But, I want
i'm still transitioning from as2 to as3, i'm having trouble with parsing XML data
I have been tasked with parsing out xml and json data into an application.
I am parsing XML, with simplexml_load_string() , and using the data within it to
I am parsing data from this XML url The text input varies, depending on
I have an HTML/XML table generated by AJAX that displays limited columns of a
I'm parsing Xml data which has entries like this: <item name=UserText type_name=gh_string type_code=10> </item>

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.