1( function($) { 2 3 if (typeof max_page_tk !== 'undefined') { 4 //Ajax Homepage Load More Button 5 var ppp = 3; // Post per page 6 var pageNumber = 1; 7 8 var button = $(".tk_loadmore"); 9 10 if(pageNumber == max_page_tk) { 11 button.attr("disabled",true); 12 button.html("No More News Items"); 13 } 14 15 function load_posts(){ 16 pageNumber++; 17 var str = '&pageNumber=' + pageNumber + '&ppp=' + ppp + '&action=more_post_ajax'; 18 $.ajax({ 19 type: "POST", 20 dataType: "html", 21 url: tk_loadmore_params.ajaxurl, 22 data: str, 23 success: function(data){ 24 var $data = $(data); 25 if($data.length){ 26 $(".news-wrapper").append($data); 27 button.html("Load More..."); 28 button.attr("disabled",false); 29 } else { 30 button.attr("disabled",true); 31 button.html("No More Posts"); 32 } 33 }, 34 error : function(jqXHR, textStatus, errorThrown) { 35 console.log(jqXHR + " :: " + textStatus + " :: " + errorThrown); 36 button.html(errorThrown + ' :\('); 37 } 38 39 }); 40 return false; 41 } 42 43 button.on("click",function(){ // When btn is pressed. 44 button.html("<i class='fas fa-spinner fa-pulse'></i>"); 45 load_posts(); 46 }); 47 } 48 49} ) ( jQuery );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.