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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:14:15+00:00 2026-05-30T12:14:15+00:00

The following code, retrieves data from my server side, outputs to the DOM. I

  • 0

The following code, retrieves data from my server side, outputs to the DOM. I also create a function that checks to see if the user scrolls to to bottom of the device. If they do I then want the AJAX call to go and grab the next ten results from my server side.

function productList(department_id,listingFirstValue,listingSecondValue){
     $.mobile.changePage( "#product", { transition: "slide"} );
     var listingFirstValueRecall = parseInt(listingSecondValue) + parseInt("1");
     var listingSecondValueRecall = parseInt(listingFirstValueRecall) + parseInt("10");
     $.ajax({
          url: //URL Goes Here,
          data: "format=json",
          jsonp: "callback",
          dataType: "jsonp",
          beforeSend:function(){
               $.mobile.showPageLoadingMsg();
          },
          success: function(data){
               var numberProducts = 0;
               $.each(data, function(index) {
                    if(numberProducts <= 10){
                          $('#product-list').append("<li id='"+data[index].product_id+"'>"+data[index].product_id+"<a href='' onclick='productPage("+data[index].product_id+");'><div class='product-listing-image-wrapper'><div class='product-listing-image'><img src='http://images.nitrosell.com/product_images/9/2083/"+data[index].product_image+"' /></div></div><div class='product-listing-textual-wrapper><div class='product-listing-name'>"+data[index].product_name+"</div><div class='product-listing-price'>&pound"+data[index].product_price+"</div></div></a><div class='kill'></div></li>").listview('refresh');
                          }
               });
               $.mobile.hidePageLoadingMsg();
          },
          error: function(){
               $.mobile.hidePageLoadingMsg();
               //Output Error
          }
     })
     $(window).scroll(function(){
          if($(document).height() > $(window).height()){
              if($(window).scrollTop() == $(document).height() - $(window).height()){
                    //Output values in alert
                    //Call function
                productList(department_id,listingFirstValueRecall,listingSecondValueRecall);
              }
          }
      });
}

I call the function from another part of the application using the following –

productList(department_id+"0,"+"10");

This will load the first ten results from the server side, no problem. When I scroll to the bottom of the browser, it will load 11, 21 from the MySQL server side.

However when I scroll to the bottom of the page again, it will load 11, 21 again then it will load 22, 32 and any other times it will keep doign this and then the next set of values

Can you guys spot anything where I am going wrong?

Thanks

  • 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-30T12:14:16+00:00Added an answer on May 30, 2026 at 12:14 pm

    Ignore this, it was an issue with MySQL server side.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have the following code that retrieves data from the database and then
I have the following code on the client side for retrieving data from the
I'm using the following code within the JCProperty class to retrieve data from a
On my site I have a jquery function which retrieves data from another (secured)
I have the following code, which will retrieve a filename from a table and
Assume that the following Perl code is given: my $user_supplied_string = &retrieved_from_untrusted_user(); $user_supplied_string =~
Following code iterates through many data-rows, calcs some score per row and then sorts
The following is a segment from a code which supposes to test communication with
I need to create an SSIS package that will do the following: Connect to
I am trying retrieve data from a .php file on a server from within

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.