Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/09/2009, 14:45
vitro012
 
Fecha de Ingreso: marzo-2009
Mensajes: 133
Antigüedad: 15 años, 10 meses
Puntos: 4
Información Editor de texto, problemas en firefox

Hola!

Tengo un editor de texo en javascript y lo combino con php, el detalle está en la parte de javascript, cuando lo uso en firefox hace una especie de recarga, en explore o chrome no hay problema.

No me acepta la funcion de copiar, pegar, viñetas, numeros...
en realidad solo funciona con letra negrita y cursiva ( De nuevo en Firefox)

La otra es que cuando cargo una imagen (gif) es cuando recarga la página

Uso lo siguiente funcion para colocar las imagenes:
>>> function trabajando() {
>>> var imagen = "<img src='gifs/trabajando.gif' />"
>>> iview.document.write(imagen);
>>> return false;
>>> }

Al aparecer el gif, en la caja de texto del iframe es cuando hace la recarga, de hecho no importa si es texto o una imagen, hace la recarga ¿Está mal usada la funcion?

Coloco código espero y puedan ayudarme..
Gracias


************************************************** ***************
<script>
function Init() {
document.getElementById('iView').contentWindow.doc ument.designMode = "on";
}
function HacerNegrita() {
document.getElementById('iView').contentWindow.doc ument.execCommand("bold", false, null);
return false;
}
function HacerCursiva() {
document.getElementById('iView').contentWindow.doc ument.execCommand("italic", false, null);
return false;
}

function copiar() {
iview.document.execCommand("copy",false, null);
return false;
}
function pegar() {
iview.document.execCommand('paste',false, null);
return false;
}
function vinetas() {
iview.document.execCommand("InsertUnorderedList");
return false;
}
function numeros() {
iview.document.execCommand("InsertOrderedList");
return false;
}
function enlace() {
iview.document.execCommand('CreateLink');
return false;
}
function negro() {
document.getElementById('iView').contentWindow.doc ument.execCommand("ForeColor",false,"#000000");
return false;
}
function rojo() {
document.getElementById('iView').contentWindow.doc ument.execCommand("ForeColor",false,"#FF0033");
return false;
}

function pienso() {
var imagen = "<img src='gifs/pienso.gif' />"
iview.document.write(imagen);
return false;
}


function trabajando() {
var imagen = "<img src='gifs/trabajando.gif' />"
iview.document.write(imagen);
return false;
}


function valorizarOculto(){
var edit=document.getElementById('iView').contentWindo w.document || document.getElementById('iView').contentDocument;
var valor=edit.body.innerHTML;
document.getElementById("valorframe").value=valor;
setTimeout(function(){alert(document.getElementByI d("valorframe").value);},300);
}

</script>

///////////////////////////////////// botones ////////////////////////////////////////////

<img src="editor_negrita.jpg" onclick="HacerNegrita()" alt="negrita"/>
<img src="editor_cursiva.jpg" onclick="HacerCursiva()" alt="CURSIVA"/>
<img src="editor_copiar.jpg" onclick="copiar()" alt="COPIAR"/>
<img src="editor_pegar.jpg" onclick="pegar()" alt="PEGAR"/>
<img src="editor_rojo.jpg" onclick="rojo()" alt="COLOR ROJO"/>
<img src="editor_negro.jpg" onclick="negro()" alt="COLOR NEGRO"/>
<img src="editor_numeros.jpg" onclick="numeros()" alt="LISTA"/>
<img src="editor_vinetas.jpg" onclick="vinetas()" alt="VIÑETAS"/>
<img src="editor_enlace.jpg" onclick="enlace()" alt="LINK"/></div>
<img src="pngifs/pienso.png" onclick="pienso()" alt="pienso" border="1"/>
<img src="pngifs/trabajando.png" onclick="trabajando()" alt="trabajando" />
</div>



*-*-**-*-*-*-*-*-*-*-* iframe campo de texto *-*-*-*-*-*-*-*-*-*-*-*-*-*-

<div>
<form action="?" method="post" onsubmit="valorizarOculto()">

<div>
<iframe id="iView" name="iview" runat ="server" style="width: 400px; height: 300px; background-color:#CCFFFF; border: 2px" frameborder="1" enableviewstate="true" allowtransparency="true" ></iframe>
<br />
</div>
<input type="hidden" name="oculto" id="valorframe" />
<input name="enviar" type="submit" value="enviar" />
</form>
</div>




Lo faltante es lo que tengo en php para almacenar en una DB, espero y puedan ayudarme.


Gracias!