Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

112
Views
El observador de mutación en iframe no se activa cuando se usa como objetivo en un formulario para la salida de php

El observador de mutación en iframe no se activa cuando se usa como objetivo en un formulario para la salida de php.

Cuando se realiza un cambio desde el script java con

 targetNode.innerHTML = 'xxx';

el observador dispara.

Cuando el formulario en el iframe muestra la salida de un archivo php, no sucede nada.

Qué estoy haciendo mal ?

Aquí está el HTML/JavaScript

 <!DOCTYPE html> <html> <head> <title>Mutation Test</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <form action="dummy.php" target='iframe'> <input type='submit'> </form> <iframe name='iframe'></iframe> <script > targetNode = document.querySelector('IFRAME').contentDocument.body; config = {childList: true, subtree: true, attributes: true}; callback = function (mutationsList, observer) { alert('mutation'); }; observer = new MutationObserver(callback); observer.observe(targetNode, config); //targetNode.innerHTML = 'xxx'; //<= this will trigger a mutaion !!!!!!!!!!!!! </script> </body> </html>

Aquí está el archivo php utilizado como acción para el formulario

 <?php echo "dummy.php";
about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!