Putting javascript code in a separate file does not work
<p>I am working with Optimizely guiders.js example code:</p>

<p><a href="http://jeffpickhardt.com/guiders/" rel="nofollow">http://jeffpickhardt.com/guiders/</a></p>

<p>Though if I extract the javascript code and place it in a separate file, the guiders do not load.</p>

<p>Here is the edited html:</p>

<pre><code>&lt;html&gt;
  &lt;head&gt;

    &lt;!-- guider.js requires jQuery as a prerequisite. Be sure to load guider.js AFTER jQuery. --&gt;
    &lt;script type="text/javascript" src="jquery-1.5.1.min.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="guider.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="guidedTour.js"&gt;&lt;/script&gt;

    &lt;link rel="stylesheet" href="guider.css" type="text/css" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;span id="clock" style="border: 2px solid #333; width: 300px; height: 200px; text-align: center;" onclick="guider.next();"&gt;
      &lt;br /&gt;
      &lt;img src="clock.gif" width=150 height=150 /&gt;
    &lt;/span&gt;


  &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>I have all the javascript code in <code>guidedTour.js</code>, in the same directory.
All js are also in same directory. And the code worked before extracting it in separate file.</p>

<p>The guiders do not load when javascript is in separate file.</p>

<p>I am getting the following error in Chrome:</p>

<blockquote>
  <p>"Uncaught TypeError: Cannot read property 'clientHeight' of null
  jquery-1.5.1.min.js:16"</p>
</blockquote>

<p>Trying a more recent version of jquery throws an error on guiders.js.
Anyway it seems a different behavior than if I keep the javascript code in the index.html.</p>

<hr>

<p>I have created a jsfiddle:</p>

<p>This is a working code:
<a href="http://jsfiddle.net/vpMQy/" rel="nofollow">http://jsfiddle.net/vpMQy/</a></p>

<p>I do not know how to create a similar jsfiddle with the javascript in a separate file so that I can reproduce the problem.</p>

<p>Is this possible?</p>
