Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I built a simple ajax and jQuery infinite scrolling. It works great on Chrome but it doesn't on Internet Explorer ...

The problem with IE is that it returns the same results more than once, like it is looping through the ajax call more than once. And each time I scroll further more and more duplicate content is appended to the end of the ID div.

Here is the code ...

$(document).ready(function(e){
	
	$(document).scroll(function(){
        if($(window).scrollTop() + $(window).height() == $(document).height()){
            var pictureCount = $(".Picture-1A").length;
			alert(pictureCount);
            $.get('ajax/more-pictures.php', {off_set:pictureCount}, function(data){
				$("#Picture-1A").append(data);
            });
        }
    });
	
});


I have searched the internet for solution and all I have come up with is that Internet Explorer cache Ajax. And they have recommended me to add:

$.ajaxSetup({cache:false});


But it doesn't work. Please try the code with a set of results and test it on IE and see what you get to understand more.

Thanks for your help guys
Farris
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900