jQuery: Can I automatically apply a plug-in to a dynamically added element?

前端 未结 4 1457
伪装坚强ぢ
伪装坚强ぢ 2021-01-21 02:33

I\'m in the process of converting my web app to a fully AJAX architecture.

I have my master page that is initially loaded and a div container that is loaded with dynamic

4条回答
  •  终归单人心
    2021-01-21 02:53

    Use the live binding in your plugin code directly

    jQuery.fn.EntitySearch = function() {
       this.live(..., function(){ your plugin code });
       return this;
    }
    

提交回复
热议问题