Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

206
Vistas
How can I fix the problem with the iframe when reloading the page in firefox?

if I enter something in the textarea and reload the page, my code is then output again in the iFrame. However, the problem only occurs in Firefox.

<div id="html-area"> </div>
<textarea id="html-editor" placeholder="HTML" oninput="changer()"></textarea>
<iframe id="viewer"></iframe>

<script>
function changer(){
var htmlcode = document.getElementById("html-editor").value;

viewfield = document.getElementById("viewer").contentWindow.document;

viewfield.open();
viewfield.write(htmlcode);
viewfield.close();
}
</script>

Can someone tell me how to work around the problem in Firefox? If there is already a similar thread, I'm sorry, couldn't find anything.

Thank you in advance for the help

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

firefox has the autocomplete value by default on
you should turn it off if you don't need to retrieve the data on refresh.

<textarea ... autocomplete="off">

when you use document.write to modify iframe content, an automatic entry is added to the session history for each use. so you should clean it at the beginning.

viewfield = document.getElementById("viewer").contentWindow.document;
viewfield.write('');

function changer() {
  var htmlcode = document.getElementById("html-editor").value;
  viewfield.open();
  viewfield.write(htmlcode);
  viewfield.close();
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda