gpt4 book ai didi

Javascript 确认框总是返回 true

转载 作者:行者123 更新时间:2023-11-29 16:59:04 26 4
gpt4 key购买 nike

<分区>

这是我的确认框代码。当我按下 OK 时,它应该调用删除函数。当我按下 Cancel 时,它应该返回主页,但即使我选择 Cancel,文件也被删除了。这是我的代码。怎么了?

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';
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com