title: Uncaught Error: Method show does not exist on jQuery.modal
body: <p>So I'm trying to force keep the bootstrap modal showing even on the toggle button click using <code>$('#myModal').modal('show');</code>
  show method works when outside .click() function but says no such method when it is inside the .click() function</p>
  
  <p>As such</p>
  
  <pre><code>$('document').ready(function() {
  
      $('#my-toggle-button').click(function() {   
          $('#myModal').modal('show'); // Throws up the below error
      });
  
  });
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Uncaught Error: Method show does not exist on jQuery.modal
  at Function.error (jquery-2.2.4.min.js:2)
  at n.fn.init.a.fn.modal (materialize.min.js:8)
  at HTMLAnchorElement.&lt;anonymous&gt; (myScript.js:4)
  at HTMLAnchorElement.dispatch (jquery-2.2.4.min.js:3)
  at HTMLAnchorElement.r.handle (jquery-2.2.4.min.js:3)
  </code></pre>
  
  <p>However it works fine when </p>
  
  <pre><code>$('document').ready(function() {
  
      $('#myModal').modal('show'); // Works fine
  
      $('#my-toggle-button').click(function() {   
  
      });
  
  });
  </code></pre>
  
  <p><strong>Update:</strong>
  Turns out it's being caused because of script imports having defer and aysnc. I don't know what's the right place to use these as they don't recognize modal.</p>