title: jQuery Bootstrap: "TypeError: 'undefined' is not a function (evaluating 'jQuery('#myModal').modal('hide')')
body: <p>In my application I want to manually close a bootstrap modal view after the ajax request has been finished.
  I call <code>jQuery('#myModal').modal('hide');</code> within the callback, </p>
  
  <pre><code>function(){                                       
     jQuery('#myModal').modal('hide');
  }
  </code></pre>
  
  <p>but the modal view doesn't get hidden. I double-checked that I include jQuery before Bootstrap, so the problem can't be there.</p>
  
  <p>I always get the following error:</p>
  
  <pre><code>TypeError: 'undefined' is not a function (evaluating 'jQuery('#myModal').modal('hide')')
  </code></pre>
  
  <p>The modal looks like this:</p>
  
  <pre><code>   &lt;!-- Modal --&gt;
  &lt;div aria-hidden="false" aria-labelledby="modalInviteFlatmateLabel" role="dialog" tabindex="-1" class="modal hide fade in" id="myModal"&gt;
      &lt;form id="add-flatmate-form" action="/flatmates/show" method="post"&gt;    
      &lt;div class="modal-header"&gt;
          &lt;button aria-hidden="true" data-dismiss="modal" class="close" type="button"&gt;&amp;times;&lt;/button&gt;
          &lt;h3 id="modalInviteFlatmateLabel"&gt;Invite Flatmate&lt;/h3&gt;
      &lt;/div&gt;
      &lt;div class="modal-body"&gt;
          &lt;p&gt;
              Enter the mail address of your flatmate you want to invite.
          &lt;/p&gt;&lt;br /&gt;
          &lt;input placeholder="E-Mail" class="input-block-level" name="AddFlatmateForm[email]" id="AddFlatmateForm_email" type="text" /&gt;    &lt;/div&gt;
      &lt;div class="modal-footer"&gt;
          &lt;input class="btn btn-primary" type="submit" name="yt0" value="Invite" id="yt0" /&gt;        &lt;!--&lt;button class="btn btn-primary"&gt;Invite&lt;/button&gt;--&gt;
      &lt;/div&gt;
      &lt;/form&gt;
  &lt;/div&gt;&lt;!--#myModal--&gt;
  </code></pre>
  
  <p>Additional information:</p>
  
  <ul>
  <li>jQuery version: 1.9.1, </li>
  <li>Bootstrap version: 2.3.2</li>
  </ul>
  
  <p>Any ideas?</p>