Scroll infini

Par libou, il y a 9 ans


Bonjour,

Voila je rencontre un petit problème avec mon code.

j'ai fait un Scroll infini comme dans le tuto ,

https://www.grafikart.fr/tutoriels/jquery/scroll-infini-249 $(window).scroll(function(){ if($(window).scrollTop() == $(document).height() - $(window).height()){ $.ajax({ url : "afficherPlusVideo.php?id=" + $(".afficherPlus:last").attr("id"), success: function(html){ if(html){ $(".afficher").append(html); }else{ alert('Y a pu de POST !'); } } }); } });

cela marche parfaitement sauf sur chrome et opera en version pc sur mobile aucun probleme
et lorsque je reduit la fenetre de chrome , cela marche avec chrome et opera

7 réponses

mxmaxime, il y a 9 ans

Bonjour.
Nous ne pouvons pas t'aider.

libou, il y a 9 ans

merci de ta reponse , mais pourquoi ?

mxmaxime, il y a 9 ans

Aucun code, aucunes informations tu crois réellement que toute la communauté connait les tutoriels par coeur?

libou, il y a 9 ans

tu as raison , j ai rajouter le code jquery

Grafikart, il y a 9 ans

Sur chrome et opera utilise la console développeur afin de voir si tu as des erreurs affichées.

libou, il y a 9 ans

la console sous chrome affiche :
Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
https://static.doubleclick.net/instream/ad_status.js Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
5https://googleads.g.doubleclick.net/pagead/id Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
et sous opera
browser.js:44 Opera has modified script or content on www.youtube.com (PATCH-1185, youtube.com - show video above playlist). See browser.js for details
ce qui correspond au code
function log(str) {
console.log('Opera has modified script or content on ' + hostname + ' (' +
str + '). See browser.js for details');
}
et j ajoute le lien

libou, il y a 9 ans

j ai mis un bouton a la place , sa marche .

<script type="text/javascript"> $(document).ready(function(){ $("#Plus").click(function(){ //$(window).scroll(function(){ //if($(window).scrollTop() == $(document).height() - $(window).height()){ alert('cliqué !'); $.ajax({ url : "afficherPlusArticle.php?id=" + $(".afficherPlus:last").attr("id"), dataType : 'html', success: function(html){ if(html){ $(".afficher").append(html); //document.getElementById('.afficher').innerHTML = html; }else{ alert('il n y a plus d article !'); } } }); //} }); }); </script>