What's the difference between `on` and `live` or `bind`?

前端 未结 7 1959
迷失自我
迷失自我 2020-11-22 16:00

In jQuery v1.7 a new method, on was added. From the documentation:

‘The .on() method attaches event handlers to the currently se

相关标签:
7条回答
  • 2020-11-22 16:48

    live is the shortcut for .on() now

    //from source http://code.jquery.com/jquery-1.7.js
    live: function( types, data, fn ) {
        jQuery( this.context ).on( types, this.selector, data, fn );
        return this;
    }
    

    also this post may be usefull for you http://blog.jquery.com/2011/11/03/jquery-1-7-released/

    0 讨论(0)
提交回复
热议问题