gpt4 book ai didi

javascript - 为什么 ASP 经典 Select Case 分支中不会弹出 javascript 警报?

转载 作者:行者123 更新时间:2023-11-28 11:26:18 26 4
gpt4 key购买 nike

为什么 JavaScript 警报不会在 ASP 经典 Select Case 分支中弹出?当我放入 Response.End 语句并运行结帐过程时,JavaScript 警报会执行其操作......但是当我将它们取出时,它们会立即跟随重定向......警报不会弹出。知道为什么吗?

If strResponse <> "000" Then
Select Case strResponse
Case "701"
%>
<script type="text/javascript">
alert("The customer is under 18 years of age based upon the date of birth.");
</script>
<%
'Response.End
Response.Redirect strRedirectCheckout
Case "702"
%>
<script type="text/javascript">
alert("The billing address is outside the United States.");
</script>
<%
'Response.End
Response.Redirect strRedirectCheckout
Case "707"
%>
<script type="text/javascript">
alert("The account holder does not have sufficient credit available for the transaction amount.");
</script>
<%
'Response.End
Response.Redirect strRedirectCheckout
Case Else
%>
<script type="text/javascript">
alert("Unable to obtain an authorization\nClick OK to be redirected back to checkout and please choose another form of payment");
</script>
<%
'Response.End
Response.Redirect strRedirectCheckout
End Select

Else ' if strResponse does == '000'; SUCCESS!!!

最佳答案

因为 Response.Redirect 会向浏览器发送一条消息,以开始导航到指示的页面。如果您希望他们首先看到弹出窗口,则在警报之后只需留在 JavaScript 中并使用 document.location.href=.....

关于javascript - 为什么 ASP 经典 Select Case 分支中不会弹出 javascript 警报?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10353763/

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