I'm generating images from a folder with this script:
$(document).ready(function() {
$.ajax({
    url: "gallery_images",
    success: function(data){
        $(data).find("a:contains(.jpg),a:contains(.gif),a:contains(.png)").each(function(){
            // will loop through
            var images = $(this).attr("href");
            $('<div class="g_image"></div>').html('<img class="g_img" src="gallery_images/'+images+'"/>').appendTo('#galerija');
        });
    }
});
});
The problem is that, then I'm trying to click the image, simple jQuery click event does not work.
$(".g_image img").click(function(){
alert("WORKING!");
});
 
     
    