Listen to changes within a DIV and act accordingly

后端 未结 7 611
谎友^
谎友^ 2020-11-28 23:34

I have a function that grabs an XML document and transforms it according to an XSL document. It then places the result into a div with the id laneconfigdisplay

7条回答
  •  南笙
    南笙 (楼主)
    2020-11-29 00:33

    http://api.jquery.com/change/

    change does only work on input form elements.

    you could just trigger a function after your XML / XSL transformation or make a listener:

    var html = $('#laneconfigdisplay').html()
    setInterval(function(){ if($('#laneconfigdisplay').html() != html){ alert('woo'); html = $('#laneconfigdisplay').html() } }, 10000) //checks your content box all 10 seconds and triggers alert when content has changed...
    

提交回复
热议问题