I know that .live()
is now deprecated but I cannot seem to change it and keep the functionality.
I just have a quick question about the
Try this:
$('table tr th').live("click", function() {
should be
$(document).on("click", "table tr th", function() {
That is how you would mimic the .live
call exactly. You could of course limit your selector from document to something more meaningful based on your DOM structure.
Edit:
Just to clarify, in your example, you are required to use $(document).on(...
because the table doesn't have any parents and is replaced during the life of your page.