The folowing script does not wait for $.get to finish loading the page before continuing with the loop:
$.each(data.songs, function(index, val) { $(\'#nowart