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 6385765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:56:26+00:00 2026-05-25T02:56:26+00:00

I’m trying to load a web page content little by little as the user

  • 0

I’m trying to load a web page content little by little as the user scrolls since the content is huge, and the user is usually only interested in the first part(s) of it.

The page consists of a big table. Everytime the user scrolls to the bottom of the page, I get a few more rows using ajax and append it to the table. Or, I want it to work that way…

My scrollingevent works as it should. The ajax request is sent as it’s supposed to, and I get the data as intended. The problem starts when I want to append this data to the table.

Let’s say my answer to the ajax request (called ‘data’ in my script) is a string like this:

'<tr class="tasklist" id="r11">
   <td class="titlecell">Some kind of string title</td>
   <td>Some kind of string</td>
 </tr>
 <tr class="tasklist" id="r12">
   <td class="titlecell">Some other kind of string title</td>
   <td>Some other kind of string</td>
 </tr>'

Then I try to use .after(data) to append those rows to my table. Only on web page, those rows fore some strange reason are inserted in the table like this:

'<tr>
   <td class="titlecell"></td>
   <td></td>
 </tr>
 <tr class="tasklist" id="r11"></tr>
 <tr>
   <td class="titlecell"></td>
   <td></td>
 </tr>
 <tr class="tasklist" id="r12"></tr>'

No cell content at all, and cells are inserted in extra rows, leaving the “original” rows empty. Not really what I wanted right? But why? Any of you web oracles who can put me back on my track again by explaining what I’m doing wrong or what a better (working) solution should look like, I’d be really really grateful!

This is my javascript function as it looks right now:

SPECIAL.loadMyTaskList = function() { 
  // to avoid multiple simultaneous function calls
  if ($('div #loader').html().trim() == '') {
    var last = $("#mytasklist .tasklist:last").attr("id");
    last = last.substring(1); // row id is on format r[number]
    $('div #loader').html('<img src="images/loading.gif" alt="Wait..."> Loading more tasks');
    $.get('includes/mytasklist.php?from='+last+'&nbr=10&ajax=1', function(data) {
      if (data=='')
        // all data is already loaded
        $(window).unbind('scroll'); 
      else 
        // append to table #mytasklist, after 
        // the last row (with class tasklist)
        $("#mytasklist .tasklist:last").after(data);
      // if browser window is so large, that the first 
      // post(s) of data fits without creating a scrollbar
      if (!BASIC.pageHasScrollbar())  
        SPECIAL.loadMyTaskList();
      $('div #loader').empty();
    });
  }
}
  • 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-05-25T02:56:27+00:00Added an answer on May 25, 2026 at 2:56 am

    I finaly found the answer to the problem myself. It wasn’t a problem with the code above. The problem was that my jquery file was corrupt (but still valid code, so firebug didn’t catch it). I suspect that a not so very thought through search-n-replace was the culprit

    • 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
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I'm making a simple page using Google Maps API 3. My first. One marker
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.