1/* 2* @desc : Ajax calls for CTA and Offers to show on front end, which appends data to cta_show or Offer_show div respectively 3* 4*/ 5jQuery(document).ready(function($) { 6 var arrPostId = []; 7 $('.btn.btn-primary').map(function(){ 8 arrPostId.push($(this).attr('attr-post-id')); 9 }); 10 // remove duplcate array entries from an array. 11 var arrUniquePostId = arrPostId.filter(function(elem, index, self) { 12 return index === self.indexOf(elem); 13 }); 14 if(arrUniquePostId != "") { 15 ajaxCTAFunc(arrUniquePostId); 16 } 17 var boolfourZeroFourFlag = $("#fourZeroFourFlag").val(); 18 function ajaxCTAFunc(arrUniquePostId) { 19 $.ajax({ 20 url: '/wp-admin/admin-ajax.php', // or example_ajax_obj.ajaxurl if using on frontend 21 data: { 22 'action': 'ctaAjaxFun', 23 'post_id' : arrUniquePostId, 24 }, 25 type : 'post', dataType: 'json', 26 success:function(data) { 27 if (data.success) { 28 $.each(data.data, function(key, val){ 29 //$('a#'+key).text(val); 30 var strSpanId = ''; 31 if(key.includes("-class") == true){ 32 var objSpanClass = key.split("-"); 33 strSpanId= 'ctaspan-'+objSpanClass[1]; 34 } 35 if(val.includes("rhp-event-cta") == true){ 36 $('span#'+strSpanId).removeClass().addClass(val); 37 } 38 }); 39 } 40 }, 41 error: function(errorThrown){ 42 console.log(errorThrown); // handle the error thrown. 43 } 44 }); 45 } 46});
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.