I’m failing at probably basic jQuery for returning a new compounded string (image src-paths) for every time an object is clicked.
$(":checkbox").click(function(){
$(":checked").each(function(){
var auswahl += $(this).attr('data-imagesrc');
});
alert(auswahl);
});
I’m later trying to send this string of image src-paths to a PHP-file to zip those images (the PHP-file zippes from an array of paths).
Unfortunately I’m not yet familiar with arrays if that would be a better solution here.
Your variable
auswahlis contained within theeachscope meaning that you can’t access it from outside of that function. Declare it outside.To send info to the server try
$.ajax.