我有一個存儲文件路徑的變量。我正在使用彈出窗口來顯示該圖像。我使用下面的腳本將php變量傳遞給javascript
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')
使用它作爲
當我給上述未存儲在變量名,腳本工作正常。但是當我嘗試給變量$ end_file時,它不起作用。我曾嘗試以下組合
echo '<td width="150"><a href="JavaScript:newPopup(\''.'$end_file'.'\');">ScreenShot</a></td>';
echo '<td width="150"><a href="JavaScript:newPopup(\'{$end_file}\');">ScreenShot</a></td>';
但沒有一個似乎工作
您使用'smarty'? – 2013-03-04 07:32:44