Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $(document).ready(function(){
- var inProcess = false;
- var num = 15;
- $(window).scroll(function() {
- if($(window).scrollTop() + $(window).height() >= $(document).height() && !inProcess) {
- $.ajax({
- url: 'http://pricel.od.ua/lazy',
- method: 'GET',
- data: {"num" : num},
- beforeSend: function() {
- inProcess = true;
- }
- }).done(function(data){
- data = JSON.stringify(data);
- data = jQuery.parseJSON(data);
- if (data.length > 0) {
- $.each(data, function(index, data){
- $("#posts").append("<a href='http://pricel.od.ua/"+ data.category +"/"+ data.slug +"'><strong>" + data.id + "</strong>. " + data.name + "</p></a>");
- });
- inProcess = false;
- num += 15;
- }
- });
- }
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement