jQuery 1.9 .live() is not a function

前端 未结 10 1232
再見小時候
再見小時候 2020-11-22 03:46

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 funct

10条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-22 04:07

    The jQuery API documentation lists live() as deprecated as of version 1.7 and removed as of version 1.9: link.

    version deprecated: 1.7, removed: 1.9

    Furthermore it states:

    As of jQuery 1.7, the .live() method is deprecated. Use .on() to attach event handlers. Users of older versions of jQuery should use .delegate() in preference to .live()

提交回复
热议问题