in the second block of the code, "oSearch" is set to country_of_interest. Any idea why it is taking 'test' instead of the country name?
Thanks!
$(document).ready(function () {
var country_of_interest = 'test';
$.ajax({
url: "http://127.0.0.1:8000/api/users/?format=json"
}).then(function (data) {
country_of_interest = (data[0].country_name);
});
$('#posts').DataTable({
autoWidth: true,
responsive: true,
"oSearch": {"sSearch": country_of_interest},
}
);
});