title: execute function after complete page load
body: <p>I am using following code to execute some statements after page load.</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
      window.onload = function () { 
  
          newInvite();
          document.ag.src="b.jpg";
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>But this code does not work properly. The function is called even if some images or elements  are loading. What I want is to call the function the the page is loaded completely.</p>