My code makes a map from a video game which is built with a large amount of smaller images.
Now the problem is at the last loop it inserts an image with an empty value. I don't really understand what I am doing wrong here.
var str = $('#tool').html();
var res = str.match(/.{1,2}/g);
$.map(res, function(value) {
if (value.length == 0) {
return;
}
$("div#tool").append('<img src="Images/Woods/' + value + '.png" />');
});