title: calling javascript function from php
body: <p>I am trying to call a javascript function from php. According to all of the examples I have been looking at the following should work but it doesn't. Why not?</p>
  
  <pre><code> &lt;?php
      echo "function test";
      echo '&lt;script type="text/javascript"&gt;    run();      &lt;/script&gt;';
  ?&gt;
  
  &lt;html&gt;
      &lt;script type="text/javascript"&gt;
          function run(){
              alert("hello world");
          }
      &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>