1//LOAD MORE BLOG 2jQuery(function($){ // use jQuery code inside this to avoid "$ is not defined" error 3 $('#btn_pagination').click(function(){ 4 5 var button = $(this), 6 data = { 7 'action': 'loadmore', 8 'query': misha_loadmore_params.posts, // that's how we get params from wp_localize_script() function 9 'page' : misha_loadmore_params.current_page 10 }; 11 12 $.ajax({ // you can also use $.post here 13 url : misha_loadmore_params.ajaxurl, // AJAX handler 14 data : data, 15 type : 'POST', 16 beforeSend : function ( xhr ) { 17 button.find('span').text($('#la_pagination').data('chargement')); // change the button text, you can also add a preloader image 18 }, 19 success : function( data ){ 20 if( data ) { 21 button.find('span').text($('#la_pagination').data('voirplus')); 22 $('#container_actus_blog').append(data); 23 misha_loadmore_params.current_page++; 24 25 if ( misha_loadmore_params.current_page == $('#la_pagination').data('maxnumpage') ) 26 button.remove(); // if last page, remove the button 27 28 // you can also fire the "post-load" event here if you use a plugin that requires it 29 // $( document.body ).trigger( 'post-load' ); 30 } else { 31 button.remove(); // if no data, remove the button as well 32 } 33 } 34 }); 35 }); 36});
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.