Foros del Web » Programando para Internet » Javascript »

execCommand no ejecuta correctamente

Estas en el tema de execCommand no ejecuta correctamente en el foro de Javascript en Foros del Web. @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código Javascript : Ver original function doQuote ( ) {           if ( editorVisible ) {       ...
  #1 (permalink)  
Antiguo 04/06/2011, 13:25
Avatar de ColdFusion  
Fecha de Ingreso: octubre-2008
Ubicación: Tocoa, Colon Honduras C.A.
Mensajes: 419
Antigüedad: 15 años, 5 meses
Puntos: 9
execCommand no ejecuta correctamente

Código Javascript:
Ver original
  1. function doQuote() {
  2.  
  3.         if (editorVisible) {
  4.         ifm.contentWindow.focus();
  5.             if (isIE) { //IE
  6.                 var range = ifm.contentWindow.document.selection.createRange();
  7.                 if (range.text == '') {
  8.                     range.pasteHTML("<blockquote>Ingrese su texto</blockquote>");
  9.            }  else myeditor.execCommand("formatblock", false, "<blockquote>" + mytxt + "</blockquote>");
  10.            
  11.             }else if (window.getSelection) { //FF
  12.            
  13.             var userSelection = ifm.contentWindow.getSelection().getRangeAt(0);
  14.           if(userSelection.toString().length==0)
  15.           myeditor.execCommand('inserthtml', false, "<blockquote>Ingrese su texto</blockquote>");
  16.           else myeditor.execCommand("formatblock", false, "<blockquote>" + userSelection.toString() + "</blockquote>");
  17.            } else myeditor.execCommand("formatblock", false, "<blockquote>" + mytxt + "</blockquote>");
  18.  
  19.     }else { AddTag('[quote]', '[/quote]');}
  20.    
  21. }

es parte de un editor bbcode y tendria que mostrar un blockquote, pero no funciona :/ alguien sabe que pasa!
  #2 (permalink)  
Antiguo 05/06/2011, 06:47
Avatar de Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 19 años, 10 meses
Puntos: 834
Respuesta: execCommand no ejecuta correctamente

Tal vez deberías usar el comando "inserthtml" en lugar de "formatblock". Aquí encontrarás un ejemplo y la solución para explorer: http://www.disegnocentell.com.ar/notas2.php?id=180

Etiquetas: correctamente, execcommand
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:45.