title: Show/Hide div in jquery
body: <p>I am trying to show and hide a div based on a condition (for facebook in this example). 
  Here is the code I am using, but for some reason, the alert works, but it still shows the div. 
  Can someone help debug this. thanks. </p>
  
  <pre><code>    &lt;?php
        // call the function to parse the signed request
  $sr_data = mySignedRequest();
  
  // check like status
  if ($sr_data-&gt;page-&gt;liked==1) {
      echo '&lt;script language="javascript"&gt;
          alert("Hello You Are a Fan");       
              document.getElementById("header").style.display = "block";
          &lt;/script&gt;';
  } else {
      echo '&lt;script language="javascript"&gt;
          alert("You are not a fan");     
              document.getElementById("header").style.display = "none";
          &lt;/script&gt;';
  }
  
  ?&gt;
  &lt;div id="header"&gt;
  
  Hello You Are a Fan
  &lt;/div&gt;&lt;!-- #header --&gt;
  </code></pre>