Javascript loading only after postback
<p>Sorry if this question may be simple, but I can't seem to find an answer, and it's just becoming more and more frustrating.  </p>

<p>So, I'm on a master page and on this master page is a nifty jQuery method to 'fade' images.  </p>

<p>Of course, the first time I load the page it blows up, but <em>only if I'm referencing it locally</em>.  </p>

<p>However, I know the path to the file is correct (or if it's not it's sure fooling me) because if I enable any sort of postback (such as logging in), when the page refreshes, the jQuery loads without incident. </p>

<p>On the other hand, <em>if I were to reference the library from Google, it loads fine each and every time.</em>  However, external libraries are not an option; everything in the live site has to be self contained.  </p>

<p>Intellisense is even running perfectly fine when I'm coding in the first place.  </p>

<p>I tried <code>$(document).ready()</code>, <code>$(window).load()</code>, moving it from the master page to the .aspx page.  Nothing works, but only the first time.  </p>

<p>Has anyone encountered something like this?  How did you solve this conundrum?  </p>

<p>(Also, I apologize again if this is something very simple).  </p>

<p>Edit: It's giving an object expected error when it loads.  Doing a bit of looking around it seemed to tell me that, nope, the library simply hasn't loaded yet.</p>

<p>Edit 2: Code: </p>

<p>I really should have done this before hand.  My fault. </p>

<pre><code>&lt;script type="text/javascript" src="Scripts/jquery-1.6.4.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" &gt;

function cycleImages() {
    var $active = $('#portfolio_cycler .active');
    var $next = ($('#portfolio_cycler .active').next().length &gt; 0) ? $('#portfolio_cycler .active').next() : $('#portfolio_cycler img:first');
    $next.css('z-index', 2); //move the next image up the pile
    $active.fadeOut(1500, function () {//fade out the top image
        $active.css('z-index', 1).show().removeClass('active'); //reset the z-index and unhide the image
        $next.css('z-index', 3).addClass('active'); //make the next image the top one
    });
}    

//$(document).ready(function () { 
//    setInterval('cycleImages()', 7000);
//});

$(window).load(function () {
    setInterval('cycleImages()', 7000);
});

&lt;/script&gt;
</code></pre>

<p>This is the jQuery method.  setInterval is the code for the fading method, but it always stops on the <code>$(window).load</code>, or <code>$(document).ready</code> it's placed in the topmost master page, in the header tag.  </p>
