<分区>
<script language="javascript" type="text/javascript">
function delete() {
var newwindow;
newwindow=window.open();
}
function edit(){
}
</script>
[...]
<table class="table table-striped">
<thead>
<th>Id</th>
<th>Titel</th>
<th>Ort</th>
<th>Referenzcode</th>
<th>Bearbeiten</th>
<th>L�schen</th>
</thead>
<tbody>
<c:forEach items="${vacancies}" var="vac">
<spring:url value="/vac" htmlEscape="true" var="vacEdit" />
<spring:url value="/vac/${vac.id}" htmlEscape="true" var="vacDelete" />
<tr>
<td><c:out value="${vac.id}"/></td>
<td><c:out value="${vac.titel}"/></td>
<td><c:out value="${vac.location}"/></td>
<td><c:out value="${vac.referenceCode}"/></td>
<td><input type="button" name="Bearbeiten" value="Edit" onclick="edit();"></td>
<td><input type="button" name="Loeschen" value="Delete" onclick="delete();"></td>
</tr>
</c:forEach>
</tbody>
</table>
Google Chrome 浏览器的 JavaScript 控制台抛出这三个错误:
Uncaught SyntaxError: Unexpected token delete vacAdmin:23
Uncaught ReferenceError: edit is not defined vacAdmin:122
Uncaught SyntaxError: Unexpected token ) vacAdmin:123
关于为什么 onclick
方法没有调用或找不到 edit()
和 delete()
函数有什么建议吗?