 <script type="text/javascript"> $(document).ready(function(){     $(window).scroll(function(){          var lastID = $('.load-more').attr('lastID');          if ($(window).scrollTop() == $(document).height() - $(window).height() && lastID != 0){             