I have some jquery functions that I call from the $(document).eady() function like the following :
<script type="text/javascript">
$(document).ready(function(){
$('.table_task_type tr').mouseover(function(){
$(this).addClass("hover");
});
$('.table_task_type tr').mouseleave(function(){
$(this).removeClass("hover");
});
$('input:checkbox').click(function() {
$(this).parent().parent().toggleClass('checked');
});
});
</script>
The thing is that I replace part of the html on some user action. I do it like :
$("#my_table").empty();
$("#my_table").html(data);
The jquery events are fired the first time the page is loaded, but as soon as the html of my table is replaced it doesn't work anymore.
Any workaround to that ?