我有一个下划线模板,我正在尝试将一个onclick事件添加到span元素。openQueryWindow()
是一个函数,我试图传递单个参数
('<%?stat= sqlcreate%>')
因为它们执行不同的sql查询.Below是模板:
<dt class="create">Create:</dt><dd class="value">'
+'<span class="create"onclick = "openQueryWindow('<%?stat= sqlcreate%>')"></span></dd>'
+'<dt class="delete">Delete:</dt><dd class="value">'
+'<span class="delete"onclick = "openQueryWindow('<%?stat= sqldelete%>')"></span></dd>'
+'<dt class="stop">Stop:</dt><dd class="value">'
+'<span class="stop"onclick = "openQueryWindow('<%?stat= sqlstop%>')"></span></dd>'.
这不是很有效,我做错了什么?任何想法?
编辑: 下面是jsp openQueryWindow():
function openQueryWindow(extra) {
<c:if test="${!actionBean.parentLoadTest}">
if (allowQueries()) {
var url = "/load/query/${actionBean.loadTest.id}";
if (extra) {
url += extra;
}
window.open(url);
} else {
notifyQueryNotAvailable();
}
</c:if>
}