window history back (-1) not working(窗口历史记录(-1)不起作用)
问题描述
我使用下面的代码返回上一页,但它不起作用.即使我在页面上单击确定",警报框仍会弹出.实际上有 3 页包含此 Windows 页面代码.第一页是用户需要填写的表格名称redeem_newcust.asp,操作应该是将所有数据保存到名为redeem_newcustDB.asp的数据库中.在redeem_newcustDB.asp 页面中有一个代码可以选择兑换类型的选项,然后此页面将指向redeem_newprocess.asp 页面的操作,其中包含如下代码.表示当用户点击不等于生日礼包 - PDV RM50"的兑换类型时,它应该返回到上一页,即页面redeem_newcustDB.asp.有可能回到上一页..?b 是否需要带来所有的价值?请帮忙,谢谢
I have use below code to back for the previous page, but it's not working. the alert box still popup even i click ok on the page. actually there have 3 page include this windows page code. 1st page is user need to fill up the form is name redeem_newcust.asp and the action should be save all the data into the database named redeem_newcustDB.asp. In page redeem_newcustDB.asp have one code to select option for type of redemption then this page will point action to the page redeem_newprocess.asp with is included as below code. Means when user click on type of redemption not equal to "Birthday Pack - PDV RM50" then it should be back to the previous page that means page redeem_newcustDB.asp. It's possible to having back to that previous page..? Should b need to bring all the value? Please help, thanks
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);
这篇关于窗口历史记录(-1)不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:窗口历史记录(-1)不起作用


基础教程推荐
- 如何在特定日期之前获取消息? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01