Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jan 2012
    Location
    Slovakia
    Posts
    111
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Load via scrolling

    Hi guys... i have this problem... it works pretty well but when i am trying this in mozilla ... sometimes it load contect two times... and i dont know why... chrome,,, opera... everything is okay... but in mozilla is the contect doubled sometimes...

    I tried to add the 'old new data' condition but it didnt help

    Code:
    jQuery(window).bind('scroll',function() {
       
           
        var $win=$(window);
            if ($win.height() + $win.scrollTop()  == $(document).height()) {
               
        var ID='';    
        ID=$("article:last").attr("id");
        var ID=parseInt(ID);
        
                 $.ajax({
    
                   type: "POST",
                   url: "/modules/load_another_statuses.php",
                   data: {ID: ID  },
                   async: false,
                   cache: false,
                   dataType: "json",          
                   beforeSend: function() {
                   document.getElementById("loading").style.display = "block";  
                   },          
                   success: function(data) {
                       
                       var NewData=data.idecko.length;                   
                       
                       if (OldData!=NewData) {
               
                       
                         $('article:last').after(data.idecko);
                         $('a[rel*=facebox]').facebox();
                         
                       }
                         
                        var OldData=data.idecko.length;
                        
                    document.getElementById("loading").style.display = "none";
                    
                   }
                       
                }); 
            }  
            
    });

  • #2
    New Coder
    Join Date
    May 2012
    Posts
    25
    Thanks
    0
    Thanked 1 Time in 1 Post
    Not exactly sure whether this gonna help you but when i load any data from the database i always do an empty() to the child of the parent div before appending the new datastream.

  • #3
    Regular Coder
    Join Date
    Jan 2012
    Location
    Slovakia
    Posts
    111
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by sayannayas View Post
    Not exactly sure whether this gonna help you but when i load any data from the database i always do an empty() to the child of the parent div before appending the new datastream.
    yea but i dont want to empty the parent div .. just add another BUT TO BE SURE IT DONT HAVE THE SAME DATA but another from DB


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •