title: Javascript - run function in iFrame after parent window has loaded
body: <p>Is there  a way to know if parent window has loaded from within iframe?</p>
  <p>I want to run  a function which is in iFrame but I need to run it after all the parent windows are loaded and the event listener will be inside the iframe.</p>
  <p>I tried the following but it runs before parent windows are loaded.</p>
  <pre><code>window.addEventListener('load', function () {
  alert(&quot;It's loaded!&quot;)
  });
  </code></pre>