1jQuery(document).ready(function($) { 2 3 $('a[data-ail]').mousedown(function(event) { 4 5 var link_type = 'ail'; 6 7 //save the click with an ajax request 8 track_link(link_type, $(this)); 9 10 }); 11 12 $('a[data-mil]').mousedown(function(event) { 13 14 var link_type = 'mil'; 15 16 //save the click with an ajax request 17 track_link(link_type, $(this)); 18 19 }); 20 21 //track the link with an ajax request 22 function track_link(link_type, caller_element){ 23 24 //set source 25 var source_post_id = caller_element.attr('data-' + link_type); 26 27 //set target 28 var target_url = caller_element.attr('href'); 29 30 //prepare ajax request 31 var data = { 32 "action": "track_internal_link", 33 "security": daim_nonce, 34 "link_type": link_type, 35 "source_post_id": source_post_id, 36 "target_url": target_url 37 }; 38 39 //send the ajax request 40 $.post(daim_ajax_url, data, function(data) {}); 41 42 } 43 44});
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.