jQuery implements the method of dynamically loading content when the page is scrolling

  • 2020-05-19 04:05:06
  • OfStack

This article demonstrates an example of how jQuery can dynamically load content when a page is scrolling. Share with you for your reference. The specific analysis is as follows:

Many websites, such as twitter and the home page of jingdong mall, will dynamically load the page content when the page scrolls to a certain position, which can speed up the page opening and save bandwidth. The JS code below can help you do this.

var loading = false;
  if(loading == false){
   loading = true;
   $.get("load.php?start="+$('#loaded_max').val(), function(loaded){
    loading = false;
$(document).ready(function() {

I hope this article has been helpful to your jQuery programming.

Related articles: