Getting CSS values and variables in an external JS file?
<p>how come a code like this</p>

<pre><code>var h = $('#searchcontainer').height();
$('#completeholder').css('height', h + 'px');
</code></pre>

<p>work when inside the html file itself and not when I load it from a .js file? I tried defining a global <em>var h;</em> inside my main file hoping that the code inside the js file would work without any luck. Any ideas? Thanks :)</p>

<p>Edit:
<a href="http://nightlifebratislava.com/demos/debug/doesnotwork.html" rel="nofollow">This one does not work</a></p>

<p><a href="http://nightlifebratislava.com/demos/debug/works.html" rel="nofollow">This one works</a></p>

<p>See the comment at the top of the code :)
When you press next on the working page, the css resizes in the end, and that's because I imported the js file into the main header.</p>
