title: PHP Code spinner
body: <p>I have a page with a PHP code that loads html code from other pages and it takes quite awhile before the user can see the page fully loaded, I was wondering how can I add like a spinner image while the PHP code is beeing processed.</p>
  
  <p>I've tried this (adding 1 loader div and 1 content div)</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;// &lt;![CDATA[
      function preloader(){
          document.getElementById("loading").style.display = "none";
          document.getElementById("content").style.display = "block";
      }//preloader
      window.onload = preloader;
  // ]]&gt;&lt;/script&gt;
  </code></pre>
  
  <p>But that wont work, I need the spinner to be displayed while the PHP code is working but theres no output.</p>