关于如何在.aspx页面用javaScript实现点按钮弹出确认提示窗口

//JavaScript js弹出确认消息框判断是否删除,删除前提示用户是否删除,点是删除,点否返回  
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">  
<HTML>  
<HEAD>  
<TITLE>黑色头发</TITLE>  
<META NAME="Generator" CONTENT="EditPlus">  
<META NAME="Author" CONTENT="">  
<META NAME="Keywords" CONTENT="">  
<META NAME="Description" CONTENT="">  
</HEAD>  
  
<BODY>  
<a href="http://heisetoufa.iteye.com" onclick="return confirm('确定将此记录删除?')">删除</a>  
</BODY>  
</HTML>
//JavaScript 实现关闭网页弹出确认窗口提示
<html>
<head>
<title>烈火网-确认关闭页面提示窗口</title>
<meta http-equiv="content-Type" content="text/html;charset=gb2312">
</head>
<!--把下面代码加到<body>与</body>之间-->
<body onbeforeunload="event.returnValue='你的页面数据尚未保存,确定退出烈火网吗?';">
关闭窗口试试!
<br /><center>如不能显示效果,请按Ctrl+F5刷新本页,更多网页代码:<a href='http://www.veryhuo.com/' target='_blank'>http://www.veryhuo.com/</a></center>
</body>
</html>
//Javascript删除数据时的确认对话框,用到了confirm函数,注意后边的location里应填入当你选择确认时需要执行的网页,可以带上参数,也就是此例中的网址处 
<title>Javascript删除确认对话框</title>
<a href='javascript:if(confirm("你确认要删除吗?"))location="/"'>删除</a>
//JavaScript点击按钮显示确认对话框
<html xmlns="http://www.w3.org/1999/xhtml">  
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />  
<title>My First Script</title>  
<script type="text/javascript">  
function test() {  
    var result = confirm("Please make sure.");  
    if (result == true) {  
        alert("You choose YES! Great!");  
    } else {  
        alert("What a bitch you are !");  
    }  
}  
</script>  
</head>  
<body>  
    <input type="button" value="Click Me!" onClick="test();" />  
</body>  
</html>  
原文地址:https://www.cnblogs.com/weicleer/p/2786339.html