Ver Mensaje Individual
  #4 (permalink)  
Antiguo 29/08/2008, 05:37
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 20 años
Puntos: 834
Respuesta: Función cuando se pierde focus

Con contenido editable me refiero a esto:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<
title>Documento sin t&iacute;tulo</title>
<
script>
window.onload=function(){
    if(
document.getElementById('pp').contentEditable){
    
//firefox 3, explorer, safari, ópera
    
document.getElementById('pp').contentEditable='true'
    
}else{//firefox 2
        
var ifr=document.createElement('iframe');
        var 
old=document.getElementById('pp');
        
ifr.id='pp';
        
ifr.frameBorder='0';
        
ifr.height='20';
        
ifr.width='100%';
        
ifr.onload=function(){
        var 
doc=ifr.contentWindow.document || ifr.contentDocument;
        
doc.body.innerHTML=old.innerHTML;
        
doc.documentElement.style.margin=doc.body.style.margin=0;
        
doc.designMode="on";
        }
        
old.parentNode.replaceChild(ifr,old);

    }
    

</script>
</head>

<body>
<div id="pp">Acá se puede escribir, igual que en el otro ejemplo que te mostré antes</div>
</body>
</html> 

Última edición por Panino5001; 29/08/2008 a las 20:05