Script:
$(document).ready(function(){
$.ajax({
type : "POST",
url : "list_controller.php",
data : "a=get&list_id=my_list",
success : function(data){
$('#list_container').innerHTML = data;
}
});
});
HTML:
<div id="list_container"></div>
The data returned from the server contains a HTML with some clickable links which should trigger another jQuery function and reload #list_container DIV again :
<a href="#" value="a=edit&list_id=my_list&user=artur&id=110" id="adminlink">
<img src="images/edit_user.png" />
</a>
I want these links to call other AJAX functions, f.ex:
$(document).ready(function(){
$('#adminlink').click(function () {
var val = $(this).attr("value");
$.ajax({
type : "POST",
url : "list_controller.php",
data : val,
success : function(data){
$('#list_container').innerHTML = data;
}
});
});
return false;
});
The problem is that I'm not able to access the #adminlink anchor element that triggers the click function.
Everything else is working flawlessly, but any of the elements of the innerHTML dynamic data can't be accessed anymore.