title: create javascript code in a php file - SAFARI/CHROME doesn't work
body: <p>I've created a .php file that write out js code like that:</p>
  
  <pre><code>&lt;?
  //my_js.php
  // javascript header
  header('Content-type: text/javascript');
  // Date in the past
  header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
  // always modified
  header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
  // HTTP/1.1
  header('Cache-Control: no-store, no-cache, must-revalidate');
  header('Cache-Control: post-check=0, pre-check=0', false);
  ?&gt;
  //
  // js code here
  //
  </code></pre>
  
  <p>then i include the script above in my index.php file like this:</p>
  
  <pre><code>&lt;script type="text/javascript" src="my_js.php?id=&lt;? echo $id ?&gt;"&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>This works perfect in Firefox, but SAFARI and CHROME doesn't include my_js.php file at all!</p>
  
  <p>What i'm doing wrong?</p>
  
  <p>**edit:</p>
  
  <p>this is the rendered html in index.php:</p>
  
  <pre><code>&lt;script type="text/javascript" src="my_js.php?id=new"&gt;&lt;/script&gt; 
  </code></pre>
  
  <p>and this is the my_js.php code:
  (it's a very big file so i write out only the first few lines)</p>
  
  <pre><code>var g = { sitepath: "myNullUrl" }
  
  function getBrowserWidth(){
  if (window.innerWidth){
      return window.innerWidth;}  
  else if (document.documentElement &amp;&amp; document.documentElement.clientWidth != 0){
      return document.documentElement.clientWidth;    }
  else if (document.body){return document.body.clientWidth;}      
      return 0;
  }
  </code></pre>
  
  <p>that's a strange problem 'cos while i'm viewing source code from Crome/Safari i can access the js file and it seems to be error free!</p>
  
  <p>I'm using Chrome 6.04 and Safari 5, both for mac.</p>