How to call ajax links out of ajax content
The following scripts are encapsulate within "$(document).ready(function()"
Script No. 1:
$("#incoming_entry").on("click", function(){
$(this).incoming_entry();
});
$.fn.incoming_entry = function() {
$.ajax({url: "./query/incoming_incoming.php", success: function(result){
$("#incoming_content").html(result);
}});
};
Via click on an a-element with the ID
incoming_entry this script No.1 generates
via PHP, MYSQL the script No. 2 into a DIV with the ID
incoming_content
.
This a-element is not in this DIV.
Great.
Script No. 2:
$("#incoming_expel").on("click", function(){
$(this).incoming_expel();
});
$.fn.incoming_expel = function() {
alert("AJAX request successfully completed");
};
I expect when I click on an a-element with the ID incoming_expel an alert.
But nothing happens.
Maybe you you know what to do.
Kai