1function trackClick(element) { 2 /** 3 * collect the appropriate data off the element 4 */ 5 let data = {}; 6 $.each($(this).data(), function (key, value) { 7 if (key.substring(0, 5) === 'track') { 8 data[key.substring(5).toLowerCase()] = value; 9 } 10 }); 11 let {url, ...trackingData} = data; 12 // send the data to the tracking url 13 $.ajax({ 14 type: "POST", 15 url: url, 16 data: trackingData 17 }); 18} 19 20 21function bindJsClick() { 22 // add onclick handlers to .js-track-click elements 23 // Add this class in combination with the {% track_onclick %} tag 24 $('.js-track-click').unbind("click", trackClick).bind("click", trackClick); 25} 26 27jQuery(document).ready(function ($) { 28 bindJsClick(); 29});
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.