Using ajax , returned data and use the data out of ajax success function
hello , i have called a php paged with ajax call and returned data successfuly but when i want to access the element,tags on the returned paged out of the ajax successed function nothing will happen i'm using .on event but nothing is happening the code is :
$.ajax({type:"POST",url:"mysql_retrive.php",data:{page:"0"},success:function(data){
$container.append(data);
}
});
and the click event :
$this.find('a').on("click",function(){
alert($(this).text());
});
this event is not working if i put it out of the success function otherwise if i put it in the success function it'll work pretty good , may i know why this is happening . do the ajax function execute after all other functions .