title: Accordion toggle redirecting before jquery load
body: <p>I have the following code causing issue on a website.
  Basically, if a user has a slow internet speed and manages to click the accordion before bootstrap js is loaded, it redirects to the homepage with #i at the end.</p>
  
  <p>I've added this at the end:</p>
  
  <pre><code>  $('.accordion-toggle').click(function(e) {
          e.preventDefault();
      });
  </code></pre>
  
  <p>But of course some users can still click the a tag before this is loaded. Any help would be great.</p>
  
  <pre><code> &lt;div class="panel-heading"&gt;
       &lt;a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#&lt;?php echo $x; ?&gt;"&gt;
                                              &lt;/a&gt;
                                          &lt;/div&gt;
  
  
  &lt;div id="&lt;?php echo $x; ?&gt;" class="panel-collapse collapse"&gt;
  &lt;/div&gt;
  &lt;div id="&lt;?php echo $x; ?&gt;" class="panel-collapse collapse"&gt;
  &lt;/div&gt;
  </code></pre>