title: Make PHP and JAVASCRIPT work together.
body: <p>I have a simple php if statement that checks for an error return on a form submit basically. </p>
  
  <pre><code>&lt;?php if ($this-&gt;session-&gt;flashdata('error')): ?&gt;
      &lt;a href="#" class="close" data-dismiss="alert"&gt;&amp;times;&lt;/a&gt;
      &lt;div class="alert alert-error" id="error"&gt;&lt;?php echo $this-&gt;session-&gt;flashdata('error'); ?&gt;&lt;/div&gt;
  &lt;?php endif ?&gt;
  </code></pre>
  
  <p>And I have this script that I want to put into this php so when the php is true the login box or <code>account-container</code> will shake. </p>
  
  <pre><code>$("#account-container").addClass("animated shake");
  </code></pre>
  
  <p>I tried echoing the script inside the php but all that was give me <code>echo ;</code> displayed on the page when the if was true. </p>