Answer the question
In order to leave comments, you need to log in
Ajax requests why not working?
$(document).ready(function(){
var num = 20;
var inProcess = false;
$(window).scroll(function(){
if ($(window).scrollTop() + $(window).height > = $(document).height() && !inProcess ){
$.ajax({
url: 'load.php',
method: 'GET',
data: {"num" : num},
beforeSend: function(){
inProcess = true;
}
}).done(function(data){
console.log(data);
data = jquery.parseJSON(data);
if (data.legth > 0) {
$.each(data, function(index, data ){
$(".videos") .append("
Answer the question
In order to leave comments, you need to log in
Use a debugger to see how your code works.
$(window).scroll(function(){
debugger;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question