Ver Mensaje Individual
  #4 (permalink)  
Antiguo 05/02/2011, 22:21
Avatar de pato12
pato12
 
Fecha de Ingreso: septiembre-2007
Ubicación: Salta
Mensajes: 1.620
Antigüedad: 16 años, 7 meses
Puntos: 101
Respuesta: Problema con eventos en iframe firefox

Bueno, miren resumí el código para demostrar como lo hago:
Código Javascript:
Ver original
  1. <script type="text/javascript">
  2. <!--
  3. var Editor = function(id){
  4.     this.init = function(){
  5.         var elwin = this;
  6.         this.input_dom = document.getElementById(id);
  7.         this.iframe_dom = document.createElement('iframe');
  8.        
  9.         with(this.iframe_dom){
  10.             src = 'about:blank';
  11.             style.height = '200px';
  12.             style.width = '500px';
  13.         }
  14.        
  15.         setTimeout(function(){
  16.             if(elwin.iframe_document.designMode)
  17.                 elwin.iframe_document.designMode = 'on';   
  18.             else if(elwin.iframe_body.contentEditable)
  19.                 elwin.iframe_body.contentEditable = true;
  20.         }, 100);
  21.        
  22.         this.input_dom.parentNode.insertBefore(this.iframe_dom,this.input_dom);
  23.        
  24.        
  25.         with((this.iframe_dom.contentDocument || this.iframe_dom.contentWindow.document)) {
  26.             clear();
  27.             open();
  28.             write("<html><body></body></html>");
  29.             close();
  30.         }
  31.        
  32.         this.iframe_document = this.iframe_dom.contentDocument || this.iframe_dom.contentWindow.document;
  33.         this.iframe_body = this.iframe_document.body || this.iframe_document.getElementsByTagName('body')[0];
  34.        
  35.         this.iframe_dom.contentWindow.onmouseup = function(){alert('activo');};
  36.     };
  37.     this.init();
  38. };
  39. var editar;
  40. window.onload=function(){
  41.     editar = new Editor('textarea');
  42. };
  43. -->
  44. </script>
  45. <textarea name="textarea" id="textarea" cols="55" rows="15"></textarea>
En chrome anda perfecto y se ejecuta el alert, y en firefox no :S..
__________________
Half Music - www.halfmusic.com