1jQuery(document).ready( function(){ 2 jQuery('.ej_analytics_ajax--load').on('click', function(e) { 3 4 //jQuery((".ej_analytics--spinner").addClass("active")); - not working :() 5 jQuery(".ej_analytics--spinner").addClass("active"); 6 jQuery(".ej_analytics_ajax--load").remove(); //forceful 7 8 var post_type = jQuery(this).data( 'type' ); // Get post type via the 'data-type' attribute of the button. 9 var post_id = jQuery(this).data( 'post_id' ); 10 var alias = jQuery(this).data( 'alias' ); 11 12 e.preventDefault(); 13 14 jQuery.ajax({ 15 url : ej_ga4_analytics.ajax_url, // Note that 'ej_analytics' is from the wp_localize_script() call. 16 type : 'post', 17 data : { 18 action : 'ej_ga4_analytics_get_content', // Note that this is part of the add_action() call. 19 nonce : ej_ga4_analytics.ej_ga4_analytics_nonce, // Note that 'ej_analytics_nonce' is from the wp_localize_script() call. 20 //post_type : post_type, //in our case this will be the date range of the analytics, initially just 30 days 21 post_id: post_id, 22 alias: alias, 23 }, 24 success : function( response ) { 25 jQuery(".ej_analytics--spinner").removeClass("active"); 26 jQuery('#ej_analytics_ajax--container').html(response); // Change the div's contents to the result. 27 }, 28 error : function( response ) { 29 alert('Error retrieving the information: ' + response.status + ' ' + response.statusText); 30 console.log(response); 31 } 32 }); 33 }); 34 jQuery('.ej_analytics--close').on('click', function(e) { 35 jQuery('.ej_analytics').addClass('hide'); 36 }); 37 38});
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.