title: Document.ready clarification?
body: <p>I lately saw some sites which uses this pattern : </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"&gt;&lt;/script&gt;
  
    &lt;script&gt; 
      $(function (){...do some stuff with plugins...});
    &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
  
    &lt;script src="myplugin1.js"&gt;&lt;/script&gt;
    &lt;script src="myplugin2.js"&gt;&lt;/script&gt;
    &lt;script src="myplugin3.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This made me think of some traps : </p>
  
  <p><kbd>Question #1</kbd></p>
  
  <p><code>document.ready</code> event is raised not executed after the plugins(JS) has been parsed.</p>
  
  <p>it is executed when the dom <strong>structure</strong> is done. (notice: I didn't say :"when all resources has been <em>downloaded</em>" !)</p>
  
  <p>So there could be a situation where the <code>document. ready</code>function will try to use a plugin variable which hasn't been  fully downloaded. (which will cause error). </p>
  
  <p>Am I right ? </p>
  
  <p><kbd>Question #2</kbd>
  This leads me to  : "never use document.ready"  <em>before</em>  the script references location ( I mean : in situations where document.ready is dependent on those script variables).</p>
  
  <p>Am I right ?</p>
  
  <p><em>p.s. Im not talking about window.load which will obviously will work here but i'll have to wait much longer.</em></p>