如果 div 内部发生变化,或者任何子 div 内容发生变化,我想提醒用户,
我试图检测的 div 在对象内部!
这是我的代码:
<object type="text/html" data="https://secure.brosix.com/webclient/?nid " style="width:710px;height:555px; border:none;">
</object>
<script>
$('#BrosixChatReceive').bind('contentchanged', function() {
// do something after the div content has changed
alert('woo');
});
$('#BrosixChatReceive').trigger('contentchanged');
</script>
对象内的代码“没有变化”
<div class="BrosixChatReceive" id="BrosixChatReceive" style="width: 344px; height: 476px; "></div>
这是从对象内部的 div 进行更改时的代码:
<div class="BrosixChatReceive" id="BrosixChatReceive" style="width: 344px; height: 476px; ">
<div class="BrosixChatWith" id="chatwith-85905" style="display: block; ">
<div class="BrosixChatItemOther"><div class="BrosixChatItemTime">18:34:36</div>
<div class="BrosixContactUsername" style="font-weight:bold;">person1</div>
<div class="BrosixChatMessage">message 1</div>
</div>
<div class="BrosixChatItemOther"><div class="BrosixChatItemTime">18:36:02</div>
<div class="BrosixContactUsername" style="font-weight:bold;">person1</div>
<div class="BrosixChatMessage">message 2</div>
</div>
<div class="BrosixChatItemOther"><div class="BrosixChatItemTime">18:36:54</div>
<div class="BrosixContactUsername" style="font-weight:bold;">person1</div>
<div class="BrosixChatMessage">message 3</div>
</div>
</div>
<div class="BrosixChatWith" id="chatwith-91218" style="display: none; ">
<div class="BrosixChatItemOther"><div class="BrosixChatItemTime">18:35:07</div>
<div class="BrosixContactUsername" style="font-weight:bold;">person2</div>
<div class="BrosixChatMessage">message 1</div>
</div>
</div>
</div>
有什么方法可以检测到这种变化,并在发生这种变化时提醒用户?
“我也无法更改 OBJECT 内网页的代码”
所以这必须在不编辑对象内容的情况下完成。