0

我有一个将数据导出到 Excel 的 ASP 文件,它工作正常。

创建excel文件后,我想添加用户确认以更新数据库。

我正在尝试使用 javascript,但未执行 javascript 代码。我认为这是因为所有内容都打印在 excel 文件中。有什么建议吗?

<%Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "content-disposition", "inline; filename=demo.xls"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Demo</title>
</head>
<body leftmargin=10 topmargin=0 rightmargin=0 bottommargin=0>
this is a sample page
<script>
if(confirm("Do you want to update the database?"))
    window.location.href="updater.asp";
</script>
</body>
</html>
4

0 回答 0