Hi Ia m budling an infinte scroll using only JS on wordpress
jQuery(function($) {
var loader= $('.loader'),
busy = false,
i = 1;
var offset = $("#i-scroll article:last").offset();
$(window).scroll( function() {
if ( ( (offset.top + $("#i-scroll article:last").height() ) - $(window).height() <= $(window).scrollTop() ) && busy === false
) {
i++;// page number incrementation
busy= true;
loader.show();//show gif
$.get( document.location.href + 'page/' + i )
.done( function ( data ){
loader.hide();//hiden gif
$("#i-scroll article:last").after( $('#i-scroll', data ).html() );
//offset upto date
offset = $("#i-scroll article:last").offset();
busy=false;
})
.fail( function() {
loader.hide();//hiden gif
});
}
});
So this is what i have tried it works and call the correct page per the console but it says it has a 403 error event if the adresse is correct. to check it out for yoursels this is the bulding website location yves.geekarts.fr thanks for all the help in advance.
Read more here: infinite scroll wordpress using Jquery 403 error?