No sé nada de tuenti. Esto funciona en Chrome:
Código PHP:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
</head>
<body>
<div class="chatDockDialogViewportFlow">
<ul id="dock_item_dialog_73209096">
<li class="me"><span class="sender">Eu</span>: hola</li>
<li class="separator"><hr></li>
<li class="received"><a id="dock_item_sender_link_65072267" href="javascript:void(0)" class="sender">Alba</a>: ola</li>
<li class="separator"><hr></li><li class="me"><span class="sender">Eu</span>: que tal</li>
<li>¿</li>
<li class="separator"><hr></li>
<li class="received"><a id="dock_item_sender_link_65072267" href="javascript:void(0)" class="sender">Alba</a>: bien</li>
<li>t?</li>
<li class="separator"><hr></li>
<li class="me"><span class="sender">Eu</span>: yo me voy chaoo</li><li>vengo en 1.5 min</li>
<li>o 2.33</li><li>nose</li><li>chao</li>
<li><img src="http://estaticosak1.tuenti.com//layout/web2-Zero/images/chat/6_emoticon_evilgrin.0497b628ba.png" alt=""></li>
<li class="info disconnected"><span>Fuches desconectado 21:31</span></li>
</ul>
</div>
<div onclick="document.getElementById('dock_item_dialog_73209096').innerHTML='<li>boo!</li>';">cambiar</div>
<div onclick="li=document.createElement('li');li.appendChild(document.createTextNode('hola!'));document.getElementById('dock_item_dialog_73209096').appendChild(li)">cambiar 2</div>
<script type="text/javascript">
document.getElementById('dock_item_dialog_73209096').addEventListener("DOMSubtreeModified", handler, true);
function handler(){
alert("hola");
}
</script>
</body>
</html>
Y esto funciona en cualquier navegador:
Código PHP:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
<script type="text/javascript">
var DR=function(f){//implementación rápida de DOMReady
if(document.addEventListener){
var func=function(){f();document.removeEventListener('DOMContentLoaded',func,false);}
document.addEventListener('DOMContentLoaded',func,false);
}else{
function r(f){/in/.test(document.readyState)?setTimeout(function(){r(f);},9):f();};
r(f);
}
}
function notificar(m){
alert(m);
}
var ns={}
DR(function(){//implementación rápida de un monitor de cambios
ns.recordar=document.getElementById('dock_item_dialog_73209096').innerHTML;
var inter=setInterval(
function(){
if(document.getElementById('dock_item_dialog_73209096').innerHTML!=ns.recordar){
ns.recordar=document.getElementById('dock_item_dialog_73209096').innerHTML;
notificar('hubo un cambio');
}
},250);
});
</script>
</head>
<body>
<div class="chatDockDialogViewportFlow">
<ul id="dock_item_dialog_73209096">
<li class="me"><span class="sender">Eu</span>: hola</li>
<li class="separator"><hr></li>
<li class="received"><a id="dock_item_sender_link_65072267" href="javascript:void(0)" class="sender">Alba</a>: ola</li>
<li class="separator"><hr></li><li class="me"><span class="sender">Eu</span>: que tal</li>
<li>¿</li>
<li class="separator"><hr></li>
<li class="received"><a id="dock_item_sender_link_65072267" href="javascript:void(0)" class="sender">Alba</a>: bien</li>
<li>t?</li>
<li class="separator"><hr></li>
<li class="me"><span class="sender">Eu</span>: yo me voy chaoo</li><li>vengo en 1.5 min</li>
<li>o 2.33</li><li>nose</li><li>chao</li>
<li><img src="http://estaticosak1.tuenti.com//layout/web2-Zero/images/chat/6_emoticon_evilgrin.0497b628ba.png" alt=""></li>
<li class="info disconnected"><span>Fuches desconectado 21:31</span></li>
</ul>
</div>
<div onclick="document.getElementById('dock_item_dialog_73209096').innerHTML='<li>boo!</li>';">cambiar</div>
<div onclick="li=document.createElement('li');li.appendChild(document.createTextNode('hola!'));document.getElementById('dock_item_dialog_73209096').appendChild(li)">cambiar 2</div>
</body>
</html>