I recently updated jQuery from 1.8 to 2.1. I suddenly discovered that the .live()
stops working.
I get the error TypeError: $(...).live is not a function
.
Is there any method I can use in place of .live()
?
I recently updated jQuery from 1.8 to 2.1. I suddenly discovered that the .live()
stops working.
I get the error TypeError: $(...).live is not a function
.
Is there any method I can use in place of .live()
?
Forward port of
.live()
for jQuery >= 1.9 Avoids refactoring JS dependencies on.live()
Uses optimized DOM selector contextI tend not to use the .on() syntax, if not necessary. For example you can migrate easier like this:
old:
new:
Here is a list of valid event handlers: https://api.jquery.com/category/forms/
You can avoid refactoring your code by including the following JavaScript code