我試圖把一個值一些JavaScript代碼中,像這樣:PHP - 回聲變量轉換爲JavaScript
<?
$page = "test";
echo ('<script id="template-download" type="text/x-jquery-tmpl">
<tr class="template-download{{if error}} ui-state-error{{/if}}">
{{if error}}
<td class="name" style="display: none;">${name}</td>
<td class="size" style="display: none;">${sizef}</td>
.....etc...
{{if thumbnail_url}}
<img src="Img/');
$page;
echo('.jpg">
{{/if}}
.....etc....
</script>');
?>
和最終值如下:
{{if thumbnail_url}}
<img src="Img/.jpg">
{{/if}}
,它不把價值?我錯過了什麼?
大衛
是什麼,輸出什麼樣子? – NullUserException