gpt4 book ai didi

javascript - 窗口历史记录返回(-1)不起作用

转载 作者:行者123 更新时间:2023-11-30 12:51:52 26 4
gpt4 key购买 nike

我已使用以下代码返回上一页,但它不起作用。即使我在页面上单击“确定”,警告框仍会弹出。实际上有 3 个页面包含此 windows 页面代码。第一页是用户需要填写的表格名称为 redeem_newcust.asp,操作应该是将所有数据保存到名为 redeem_newcustDB.asp 的数据库中。在页面 redeem_newcustDB.asp 中有一个代码来选择赎回类型的选项,然后此页面将指向页面 redeem_newprocess.asp 的操作,其中包含如下代码。意味着当用户单击不等于“生日包 - PDV RM50”的兑换类型时,它应该返回到前一页,即 redeem_newcustDB.asp 页面。有可能回到上一页..? b 是否需要带上所有的值?请帮忙,谢谢

If redeemtype = "Birthday Pack - PDV RM50" then
Response.Redirect("redeem_newbirth.asp?cardno="&BlinkCard&"&redeemtype="&redeemtype&"")
Else
%>
<script language="javascript">
<!--
window.alert ("Please choose Type of Redemption");
window.history.go(-1);
//-->
</script>
<%
End If

%>

最佳答案

使用:window.history.back() 代替 .go();

http://www.w3schools.com/jsref/met_his_back.asp

或使用:

window.alert("Please choose Type of Redemption");
setTimeout(function(){
window.history.go(-1);
},500);

关于javascript - 窗口历史记录返回(-1)不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20694754/

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