I'm using .on()
to bind events of divs that get created after the page loads. It works fine for click, mouseenter... but I need to know when a new div of class MyClass has been added. I'm looking for this:
$('#MyContainer').on({
wascreated: function () { DoSomething($(this)); }
}, '.MyClass');
我该怎么做呢?我已经设法在没有插件的情况下编写了我的整个应用程序,我想保持这种方式.
Thanks.