Is jquery .bind() deprecated?

前端 未结 4 1607
长情又很酷
长情又很酷 2021-01-17 23:11

Is jquery bind() deprecated or it can be used safely?

I see a lot of comments about bind() being deprecated in comments and answers across SO like: Jque

4条回答
  •  感情败类
    2021-01-17 23:43

    .bind() and .delegate() are deprecated as of jQuery 1.12 and 2.2. These functions work well with no warning message in 1.12 or 2.2, but will not work in next version and (of course) in 3.0.

    It is strongly recommended to use .on() instead of .bind() and .delegate().

    http://blog.jquery.com/2016/01/08/jquery-2-2-and-1-12-released/ https://github.com/jquery/jquery/issues/2288

提交回复
热议问题