为何我的立刻执行函数不论点击确定还是取消都会执行后面代码?
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage=""%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<jsp:useBean id="db" class="com.cn.BEService.connectDB" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>删除计划产量</title>
</head>
<body>
<%
String dwbh = request.getParameter("dwbh");
dwbh = new String(dwbh.getBytes("ISO-8859-1"), "utf-8");
String nd = request.getParameter("nd");
String id = request.getParameter("id");
%>
<script type="text/javascript">
(function(dwbh,nd){
if (confirm("确定删除单位编号"+dwbh+"在"+nd+"年度计划产量吗?")==false){
alert("确定删除");
return ;
}
}('<%=dwbh%>',<%=nd%>));
</script>
<%
int cnt = 0;
String sql3 = "DELETE FROM BENDJHCL where id=? ";
cnt = db.executeUpdate(sql3, id);
db.closeDB();
%>
<%
if (cnt > 0) {
%>
<script>
alert("成功删除<%=dwbh%>在<%=nd%>年度计划产量");</script>
<%} else {%>
<script>
alert("<%=dwbh%>产量删除<%=nd%>计划产量失败");</script>
<script>
<%}%>
<script>window.navigate("jhclcx.jsp")</script>
</body>
</html>