onLoad of new element, delegate/on?

前端 未结 2 1389
盖世英雄少女心
盖世英雄少女心 2020-12-18 03:01

Im trying to run a function on an element (.this_button) that is being loaded dynamically. Im using the following code:

$(function(){
    $(\"b         


        
2条回答
  •  生来不讨喜
    2020-12-18 04:03

    From the documentation:

    "In all browsers, the load, scroll, and error events (e.g., on an element) do not bubble. [...] Such events are not supported for use with delegation, but they can be used when the event handler is directly attached to the element generating the event."

提交回复
热议问题