<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>
谷歌浏览器的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()
函数?