Using .ajax() I am dynamically loading a list of images where the path is based on a "select" .trigger().
My "delete" function worked before loading the images on document ready but not after. I was able to get it working again by using .on() but am wondering if there is a better way.
Is is good practice to use this function or should it be a last resort?
$(document).ready(function(){
$("#displayGallery").change(function () {
//ajax
}).trigger('change');
});
$(document).on("click", ".deletepic", function(){
//ajax
return false;
});