Turning live() into on() in jQuery

后端 未结 5 2191
盖世英雄少女心
盖世英雄少女心 2020-11-21 22:28

My application has dynamically added Dropdowns. The user can add as many as they need to.

I was traditionally using jQuery\'s live() method to detect w

5条回答
  •  囚心锁ツ
    2020-11-21 23:22

    jquery verision x.x.x.js open editor, find jQuery.fn.extend

    add code

    live: function( types, data, fn ) {
            jQuery( this.context ).on( types, this.selector, data, fn );
            return this;
        },
    

    Example : jquery-2.1.1.js --> line 7469 (jQuery.fn.extend)

    Example images view

提交回复
热议问题