When user clicks a link, it runs $.post
to retrieve some data and display it. One of the links pulls a table of sessions with a button next to every session. Here is the code for one of the buttons:
<button class="view_session btn btn-info" id="3f87d50493698d06b9b48abe36cd8fc8">Details</button>
And here is my jQuery function:
$('.view_session').click(function(){
$('#blanket').show();
$('#load').show();
$.post("admin/session.php", { id: $(this).attr('id') }, function(data){
$('#sort').html(data);
$('#first').hide();
$('#load').hide();
$('#blanket').hide();
});
});
But nothing happens. I put in a Console.log
to test and nothing triggered. Is there something I have to do because the button is being created after the page loads initially?