title: best way of unobtrusive onload in plain javascript
body: <p>what is the best <strong>unobtrusive</strong> way of invoking something after the page is being loaded in plain javascript?     of course in jquery i would use </p>
  
  <pre><code>$(document).ready(function(){...});
  </code></pre>
  
  <p>but i am not sure about the most reliable approach in plain js.</p>
  
  <p>clearly </p>
  
  <pre><code>window.onload = ...
  </code></pre>
  
  <p>is not proper solution, because it would overwrite previous declaration.</p>
  
  <p>what I am trying to do is to insert an iframe into a div after the page is loaded, but maybe there are actually better ways of doing it. My plan is to do something like</p>
  
  <pre><code>window.onload = function(divId){
   var div = document.getElementById(divId);
   div.innerHTML = "&lt;iframe src='someUrl' .. &gt;";
  }
  </code></pre>
  
  <p>EDIT: 
  apologizes for not including all necessary details.
  The script is not for my website - the idea is to show a part of my site (a form) on external web sites. The priority is to minimize the effort someone has to put to use my code . That is why I would like to keep everything in js file and absolutely nothing in <code>&lt;script&gt;</code> - except of <code>&lt;script src="http://my.website/code.js" /&gt;</code>. If I change url of an iframe or i would like to add some features, I would like to update the code on all other web sites without asking them to make any changes.<br>
  My approach might be wrong - any suggestions are very welcome.</p>