$(document).ready(function(){ var inProgress = false; var startFrom = 10; $(window).scroll(function() { if($(window).scrollTop() + $(window).height() >= $(document).height() - 200 && !inProgress) { $.ajax({ url: '/click/taxicityplus', method: 'POST', data: { "startFrom" : startFrom, "tablename" : "стоматология", "LocalityName" : "Туапсе"}, beforeSend: function() { inProgress = true;} }).done(function(data){ data = jQuery.parseJSON(data); if (data.length > 0) { $.each(data, function(index, data){ if (data.AdministrativeAreaName!='') { data.AdministrativeAreaName = data.AdministrativeAreaName+' - '; }; $("#articles").append( '