1jQuery(document).ready(function ($) { 2 const debug = countryFilter.debug && countryFilter.is_admin; 3 4 function logDebug(message) { 5 if (debug) { 6 console.log(`[Country Filter Plugin]: ${message}`); 7 } 8 } 9 10 $('#alphabet').on('change', function () { 11 const alphabet = $(this).val(); 12 $('#country-list').html('<li>Loading...</li>'); 13 14 logDebug(`Sending AJAX request with filter: ${alphabet || 'Show All'}`); 15 16 $.post(countryFilter.ajax_url, { 17 action: 'fetch_countries', 18 alphabet: alphabet, 19 }, function (response) { 20 if (response.success) { 21 const countries = response.data; 22 $('#country-list').html(''); 23 if (countries.length > 0) { 24 countries.forEach(country => { 25 $('#country-list').append(`<li>${country}</li>`); 26 }); 27 logDebug(`Successfully loaded ${countries.length} countries.`); 28 } else { 29 $('#country-list').html('<li>No countries found.</li>'); 30 logDebug('No countries found for the selected filter.'); 31 } 32 } else { 33 $('#country-list').html('<li>Error fetching countries.</li>'); 34 logDebug(`Error: ${response.data || 'Unknown error occurred.'}`); 35 } 36 }).fail(function (jqXHR, textStatus, errorThrown) { 37 $('#country-list').html('<li>Error fetching countries.</li>'); 38 logDebug(`AJAX request failed: ${textStatus} - ${errorThrown}`); 39 }); 40 }); 41});
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.