我搜索了如下解决方案:
if( content from $('#div') is change -> start function test(); )
我用 $('#div').html('blub'); 更改内容
提前致谢! 彼得
PS:我知道,使用 setTimeout 是可能的,但这是一个非常肮脏的解决方案:/
最佳答案
我认为实现这一点的最佳方法是编写一个自定义 html 函数,如下所示:
function changeHtml(content) {
this.html(content);
yourChangeHandler(this);
}
编辑:或者通过更改事件... http://forum.jquery.com/topic/what-is-the-best-way-to-handle-onchange-event-on-a-div
关于Jquery - 当 div 内容更改时如何启动函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3493052/