这是我的确认框代码。当我点击 确定
时,它应该调用删除函数。当我点击 取消
时,它应该返回主页,但即使我选择了取消
,文件也被删除了。这是我的代码。问题出在哪里?
var response = confirm ("Are you sure you want to permanently delete this user?");
if (response)
{
<% String userName =request.getParameter("userName");
del.del(userName);
%>
window.location.href='adminHome.jsp';
}
else
{
window.location.href='adminHome.jsp';
}