title: Jquery $("#accordion").accordion is not working
body: <p>I am using <code>jQuery</code> accordion. In my jsp I have following structure:</p>
  
  <pre><code>&lt;div id="accordion"&gt;
  
      &lt;c:if...&gt;
          &lt;h3&gt;Heading 1&lt;/h3&gt;
          &lt;div&gt;
              &lt;table&gt;
                  Content 1
              &lt;/table&gt;
          &lt;/div&gt;
      &lt;/c:if...&gt;
  
      &lt;c:if&gt;
          &lt;h3&gt;Heading 2&lt;/h3&gt;
          &lt;div&gt;
              &lt;table&gt;Content 2
              &lt;/table&gt;
          &lt;/div&gt;
      &lt;/c:if&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>Following are the jquery i have included in the same order as given.</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>I am trying to have the first element open (i.e "Heading 1" and "Content 1") on page load. When user clicks on second "Heading 2", the first heading should close automatically.</p>
  
  <p>I tried using the following code to load the accordion on <code>document.ready</code>:</p>
  
  <pre><code>$(document).ready(function() { 
      $( "#accordion" ).accordion({ active: 0 });
  });
  </code></pre>
  
  <p>But I am still getting the error:</p>
  
  <blockquote>
    <p>Object does not support the property or method.</p>
  </blockquote>