jQuery .change() stops working when I remove a debug alert()
<p>So I have the following code at the moment:</p>

<pre><code>&lt;form action=""&gt;


&lt;div id="term"&gt;&lt;select name="s2" &gt;
&lt;option name="" value=""&gt;--Select Term--&lt;/option&gt;
&lt;/select&gt;&lt;/div&gt;

&lt;div id="dept"&gt;&lt;select name="s3"  &gt;
&lt;option name="" value=""&gt;--Select Department--&lt;/option&gt; 
&lt;/select&gt;&lt;/div&gt;

&lt;div id="course"&gt;&lt;select id='selCourse' value=""&gt;
&lt;option name="" value=""&gt;--Select Course--&lt;/option&gt; 
&lt;/select&gt;&lt;/div&gt;

&lt;div id="sec"&gt;&lt;select id='selSec' value=""&gt;
&lt;option name="" value=""&gt;--Select Section--&lt;/option&gt;
&lt;/select&gt;&lt;/div&gt;
</code></pre>

<p> </p>

<pre><code>&lt;script&gt;
    $('#term').load('fetchcourses.php?');
    alert('It Works');
    &lt;/script&gt;
    &lt;script&gt;
    $('[name=s2]').change(function() {
      $('#dept').load('fetchcourses.php?term='+$(this).val());
    });
    &lt;/script&gt;
</code></pre>

<p>It works as it, however, if I remove the <code>alert('It Works')</code> the code will load the data correctly for the first line, but nothing happens for .change().</p>

<p>I've looked at similar issues on here and other places, and apparently it has to do with asynchronous code? However, I don't really understand what that means, or how to resolve it. Any help is appreciated!</p>
