Create a jQuery special event for content changed

后端 未结 4 1058
面向向阳花
面向向阳花 2020-12-07 23:48

I\'m trying to create a jQuery special event that triggers when the content that is bound, changes. My method is checking the content with a setInterval and check if the con

4条回答
  •  借酒劲吻你
    2020-12-08 00:02

    The finished code in the original question worked for me, thank you! I would just like to note that I am using jquery 1.9.1 and $.event.handle seems to have been removed. I changed the following to get it to work.

    jQuery.event.handle.call(self, {type:'contentchange'});

    to

    jQuery.event.dispatch.call(self, {type:'contentchange'});

提交回复
热议问题