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

214
Vistas
Iframe observer not working, how to use MutationObservers

Im trying to make a mutationObserver that calls a callback function whenever this iframe subtree is modified (a element is added or remove, ex.: a <p> element). However, i cannot get this to work. I dont know what im doing wrong. I only got it to work without using the inline function (and using the function example(){} model), but it fires once when the page loads and then it never fires again.

<div id="main_content_container" name="main_content_container">
            <!-- Resposta das buscas -->
            <iframe name="dummyframe" id="dummyframe" style="display: none;">
            </iframe>
            <script>
                const myframe = document.getElementById("dummyframe").contentWindow.document.body;
                const config = {attributes:true,childList:true,subtree:true};
                var observer = new MutationObserver((mutation) => {
                    console.log("modified");
                });
                observer.observe(myframe,config);
            </script>
        </div>

about 4 years ago · Juan Pablo Isaza
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