$.ajax({ type: "GET", url: "https://www.domaker.work/ranking/get", data: "genreId=208966", }).done(function(data, textStatus, jqXHR){ // 成功の場合処理 $("#ranking").html(data); }); $.ajax({ type: "GET", url: "https://www.domaker.work/nowitem/get", data: "", }).done(function(data, textStatus, jqXHR){ // 成功の場合処理 if (data != 1){ $("#nowItem").html(data); } }); }); $(document).ajaxSuccess(function(event, xhr, settings ) { var lazyImages = [].slice.call(document.querySelectorAll("img.lazyload")); if ("IntersectionObserver" in window) { let lazyImageObserver = new IntersectionObserver(function(entries, observer) { entries.forEach(function(entry) { if (entry.isIntersecting) { let lazyImage = entry.target; lazyImage.src = lazyImage.dataset.src; if (typeof lazyImage.dataset.srcset === "undefined") { }else{ lazyImage.srcset = lazyImage.dataset.srcset; } lazyImage.classList.remove("lazyload"); lazyImageObserver.unobserve(lazyImage); } }); }); lazyImages.forEach(function(lazyImage) { lazyImageObserver.observe(lazyImage); }); } });