いくつかの画像を動的に生成しています:
<#list content.templates as template>
<td>
<img class="event_template" title="${template.getTemplateName()}" id="${template.getTemplateName()}" src="${template.getTemplatePicturePath()}" width="170px" height="140px"/>
</td>
</#list>
私のjavascriptファイルでは、これらすべての画像IDを配列で取得し、jQuery関数などを使用したいと考えています。
私は次のことを試しました:
var templates = [<#list content.templates as temp>$("#"+${temp.getTemplateName()}),</#list>];
しかし、エラーが発生しました:
キャッチされないエラー:構文エラー、認識されない式:#[object HTMLImageElement]
(jquery-1.8.2.min.js:2)
誰かが何が悪いのか手がかりを得ますか?ありがとう!