I have this script to make a new ajax call when the user scroll down. But how to make it to do it once. Since if the user scroll to fast they are n ajax calls with the same data.
$(window).scroll(function(){
whenTo=$(window).scrollTop();
if(whenTo>=($(document).height()-($(window).height())-600)){
// make ajax call
}
});
How about adding in a boolean value that checks if it has already been done?
for example:
Using this method means you can just change the variable to false whenever you like to allow the ajax to be called again if needed.