Passing php variable to javascript
<p>I have a variable which stores the path of the file. I am using a pop up window to display that image. I am using following script</p>

<pre><code>function newPopup(url) {
    popupWindow = window.open(
        url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no,status=yes')
</code></pre>

<p>Using it as</p>

<pre><code>echo '&lt;td width="150"&gt;&lt;a href="JavaScript:newPopup(\'ajax-loader.gif\');"&gt;ScreenShot&lt;/a&gt;&lt;/td&gt;';
</code></pre>

<p>When I give the name not stored in variable as mentioned above, the script works fine. But when I try to give the variable $end_file, it is not working. I have tried following combinations</p>

<pre><code> echo '&lt;td width="150"&gt;&lt;a href="JavaScript:newPopup(\''.'$end_file'.'\');"&gt;ScreenShot&lt;/a&gt;&lt;/td&gt;';
 echo '&lt;td width="150"&gt;&lt;a href="JavaScript:newPopup(\'{$end_file}\');"&gt;ScreenShot&lt;/a&gt;&lt;/td&gt;';
</code></pre>

<p>But none seems to work</p>
