I have a function that uses a jquery .each() selector to populate a table by obtaining the id of each span with a particular class, and then passing that id into an Ajax function.
function populate(){
$('#thelist span').each(function()
{
let id = this.id;
let url = `importer.php?id=${id}`;
$.ajax(
{
url: url,
success: function(result)
{
$("#"+id).html(result);
}
});
})
};
My question is how to increase the performance. I understand that .each() is causing the delay. Is there a better way to write this?