Issue with php outputting Javascript
<p>I have an image rotation script I wrote in php that randomly finds images from directories, and outputs Javascript.</p>

<p>I call this file with:</p>

<pre><code>&lt;script type="text/javascript" src="getImage.php?t=home"&gt;
&lt;/script&gt;
</code></pre>

<p>This file php file writes:</p>

<pre><code> document.write('&lt;div id="slideshow"&gt;&lt;img src="images/work/Rotate.jpg" alt="" class="active" /&gt;&lt;img src="images/work/Rotate.jpg" alt="" /&gt;&lt;img src="images/work/Rotate.jpg" alt="" /&gt;&lt;img src="images/work/Rotate.jpg" alt="" /&gt;&lt;img src="images/work/Rotate.jpg" alt="" /&gt;&lt;img src="images/work/Rotate.jpg" alt="" /&gt;&lt;img src="images/work/Rotate.jpg" alt="" /&gt;&lt;/div&gt;');
</code></pre>

<p>and uses the php header:</p>

<pre><code>Header("content-type: application/x-javascript");
</code></pre>

<p>to send the file as a Javascript file.</p>

<p>The weird thing is, this works on two different hosting accounts with different companies, but not on a third.</p>

<p>Does anybody have any idea what I might be missing?  I have tried changing the Header content type and tried adding <a href="http://serverfault.com/questions/244828/set-mime-type-of-php-generated-javascript-file">this</a></p>

<pre><code>AddHandler application/x-httpd-php .js
AddType application/javascript .js
</code></pre>

<p>to the .htaccess but it didn't work.</p>
