views:

12

answers:

0

I need to add an ability to a Firefox extension to handle cases when IFRAME elements are being added dynamically. Is there a way to get notified when IFRAME document is loaded in such a case?

For example:

<html> 
<head> 

<title>iframe test</title> 

<script type="text/javascript">
  function addIFrame() {
    var ifrm = document.createElement("iframe");
    ifrm.setAttribute("src", " http://www.google.com/");
    document.body.appendChild(ifrm);
  }
  setTimeout('addIFrame()', 3000);
</script> 
</head> 

<body>
<p>A new &lt;iframe&gt; will be added in 3 seconds:</p>
</body>

</html>