I make an AJAX call and import the data to my html. Now I want to make an alert when I click a certain div.
In the past I always used .on() on elements after an AJAX call. This time its not working but AjaxComplete is working.
Any explination for this ?
NOT WORKING :
$( ".morec" ).on("click",function() {
alert('test');
});
WORKING :
$(document).ajaxComplete(function(){
$( ".morec" ).click(function() {
alert('test');
});
});