我有一个购物车页面,在该页面中,我创建了一个示例购物清单,例如EX: - sample1,一旦我创建了,如果我希望我可以删除购物车 但是当我试图创建另一个购物清单作为EX: - sample2'..with撇号时,该项目没有删除 任何人都可以建议我做什么改变
代码如下:
<c:forEach var="wishList" items="${wlist}">
<tr class=" ">
<td><a href="javascript:createwishlist('${wishList.name}')" >${wishList.name}</a> </td>
<td> <fmt:formatDate pattern="dd/MM/yy"
value="${wishList.lastmodifieddate}" /></td>
<td class="centred"><a href="javascript:deletewishlist('${wishList.name}','${removewishlistUrl}')"><spring:theme code="delete.table.shoppinglist"/></a></td>
</tr>
</c:forEach>
在第一个例子中它采取'sample1' 在第二个它采取'样品2'这样的,这就是为什么它不删除你可以PLZ建议我如何修改它
<div class="shoplist">
<c:if test="${not empty wlist}">
<table cellpadding="0" cellspacing="0" class="tableshoplist">
<tbody>
<tr class="header">
<td width="75%"><spring:theme
code="name.table.shoppinglist" /></td>
<td width="15%"><spring:theme code="date.table.shoppinglist" /></td>
<td width="10%" align="center"><spring:theme
code="delete.table.shoppinglist" /></td>
</tr>
<c:forEach var="wishList" items="${wlist}">
<tr class=" ">
<td><a href="javascript:createwishlist('${wishList.name}')">${wishList.name}</a>
</td>
<td><fmt:formatDate pattern="dd/MM/yy"
value="${wishList.lastmodifieddate}" /></td>
<td class="centred"><a
href="javascript:deletewishlist('${wishList.name}','${removewishlistUrl}')">
<spring:theme code="delete.table.shoppinglist" />
</a></td>
</tr>
</c:forEach>
</tbody>
</table>
</c:if>
</div>
------------------------------- JavaScript函数
function deletewishlist(id, url) {
var r = confirm("Are you sure you want to delete shopping list");
if (r == true) {
$("#existname").val(id);
$("#wishlistform").attr("action", url);
$("#wishlistform").submit();
} else {
txt = "You pressed Cancel!";
}
}